logging: fix dictionary database not being generated
Fix the dictionary database not being generated under some situations even though CONFIG_LOG_DICTIONARY_DB_TARGET is disabled. For example, build and run through QEMU via west build -t run. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
5b4c8945fd
commit
531557a772
1 changed files with 27 additions and 10 deletions
|
@ -1989,22 +1989,39 @@ elseif(CONFIG_LOG_MIPI_SYST_USE_CATALOG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LOG_DICT_DB_NAME_ARG)
|
if(LOG_DICT_DB_NAME_ARG)
|
||||||
if (NOT CONFIG_LOG_DICTIONARY_DB_TARGET)
|
set(log_dict_gen_command
|
||||||
set(LOG_DICT_DB_ALL_TARGET ALL)
|
|
||||||
endif()
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${LOG_DICT_DB_NAME}
|
|
||||||
COMMAND
|
|
||||||
${PYTHON_EXECUTABLE}
|
${PYTHON_EXECUTABLE}
|
||||||
${ZEPHYR_BASE}/scripts/logging/dictionary/database_gen.py
|
${ZEPHYR_BASE}/scripts/logging/dictionary/database_gen.py
|
||||||
${KERNEL_ELF_NAME}
|
${KERNEL_ELF_NAME}
|
||||||
${LOG_DICT_DB_NAME_ARG}=${LOG_DICT_DB_NAME}
|
${LOG_DICT_DB_NAME_ARG}=${LOG_DICT_DB_NAME}
|
||||||
--build-header ${PROJECT_BINARY_DIR}/include/generated/zephyr/version.h
|
--build-header ${PROJECT_BINARY_DIR}/include/generated/zephyr/version.h
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
|
||||||
COMMENT "Generating logging dictionary database: ${LOG_DICT_DB_NAME}"
|
|
||||||
DEPENDS ${logical_target_for_zephyr_elf}
|
|
||||||
)
|
)
|
||||||
add_custom_target(log_dict_db_gen ${LOG_DICT_DB_ALL_TARGET} DEPENDS ${LOG_DICT_DB_NAME})
|
|
||||||
|
if (NOT CONFIG_LOG_DICTIONARY_DB_TARGET)
|
||||||
|
# If not using a separate target for generating logging dictionary
|
||||||
|
# database, add the generation to post build command to make sure
|
||||||
|
# the database is actually being generated.
|
||||||
|
list(APPEND
|
||||||
|
post_build_commands
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo "Generating logging dictionary database: ${LOG_DICT_DB_NAME}"
|
||||||
|
COMMAND ${log_dict_gen_command}
|
||||||
|
)
|
||||||
|
list(APPEND
|
||||||
|
post_build_byproducts
|
||||||
|
${LOG_DICT_DB_NAME}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
# Seprate build target for generating logging dictionary database.
|
||||||
|
# This needs to be explicitly called/used to generate the database.
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${LOG_DICT_DB_NAME}
|
||||||
|
COMMAND ${log_dict_gen_command}
|
||||||
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||||
|
COMMENT "Generating logging dictionary database: ${LOG_DICT_DB_NAME}"
|
||||||
|
DEPENDS ${logical_target_for_zephyr_elf}
|
||||||
|
)
|
||||||
|
add_custom_target(log_dict_db_gen DEPENDS ${LOG_DICT_DB_NAME})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add post_build_commands to post-process the final .elf file produced by
|
# Add post_build_commands to post-process the final .elf file produced by
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue