Kconfig.zephyr: add an option for checking build time init priority

Add an option for running the build time initialization priority check
as part of the build.

By default the build is going to fail if any error is reported
(dependent devices, inverted priority), optionally it can also be failed
on warnings (dependent devices, same priority).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-03-09 17:29:54 +00:00 committed by Carles Cufí
commit 2264c14fdf
2 changed files with 32 additions and 0 deletions

View file

@ -1759,6 +1759,19 @@ if(CONFIG_BUILD_OUTPUT_INFO_HEADER)
)
endif()
if(CONFIG_CHECK_INIT_PRIORITIES)
if(CONFIG_CHECK_INIT_PRIORITIES_FAIL_ON_WARNING)
set(fail_on_warning "--fail-on-warning")
endif()
list(APPEND
post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/check_init_priorities.py
--build-dir ${PROJECT_BINARY_DIR}/..
--edt-pickle ${EDT_PICKLE}
${fail_on_warning}
)
endif()
# Generate and use MCUboot related artifacts as needed.
if(CONFIG_BOOTLOADER_MCUBOOT)
get_target_property(signing_script zephyr_property_target SIGNING_SCRIPT)