2023-03-29 23:35:44 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.20.0)
|
|
|
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
|
|
|
|
|
|
set(output_file ${PROJECT_BINARY_DIR}/check_init_priorities_output.txt)
|
|
|
|
|
2023-09-09 02:10:13 +08:00
|
|
|
add_custom_command(
|
2023-03-29 23:35:44 +08:00
|
|
|
COMMENT "Running check_init_priorities.py"
|
2023-09-09 02:10:13 +08:00
|
|
|
OUTPUT ${output_file}
|
2023-11-23 20:31:06 +08:00
|
|
|
DEPENDS
|
|
|
|
${logical_target_for_zephyr_elf}
|
|
|
|
$<$<TARGET_EXISTS:native_runner_executable>:native_runner_executable>
|
2023-03-29 23:35:44 +08:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/check_init_priorities.py
|
2023-11-23 20:31:06 +08:00
|
|
|
--elf-file=$<IF:$<TARGET_EXISTS:native_runner_executable>,${BYPRODUCT_KERNEL_EXE_NAME},${BYPRODUCT_KERNEL_ELF_NAME}>
|
2023-03-29 23:35:44 +08:00
|
|
|
--verbose
|
|
|
|
--output ${output_file}
|
|
|
|
--always-succeed
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${APPLICATION_SOURCE_DIR}/validate_check_init_priorities_output.py
|
|
|
|
${output_file}
|
|
|
|
)
|
2023-09-09 02:10:13 +08:00
|
|
|
|
|
|
|
add_custom_target(check_init_priorities_output ALL DEPENDS ${output_file})
|
2023-03-29 23:35:44 +08:00
|
|
|
|
|
|
|
project(check_init_priorities)
|
|
|
|
|
|
|
|
target_sources(app PRIVATE src/main.c)
|