Skip to content

Commit a846e72

Browse files
mtpr-otcarlescufi
authored andcommitted
cmake: DTS post-processing of ELF file depends on CONFIG_HAS_DTS
Only run gen_handles.py if CONFIG_HAS_DTS is set. This enables vendors without device tree implementations to compile without the generated dependencies. Signed-off-by: Morten Priess <mtpr@oticon.com>
1 parent 8e9884f commit a846e72

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

CMakeLists.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -768,19 +768,21 @@ if(CONFIG_GEN_ISR_TABLES)
768768
set_property(GLOBAL APPEND PROPERTY GENERATED_KERNEL_SOURCE_FILES isr_tables.c)
769769
endif()
770770

771-
# dev_handles.c is generated from ${ZEPHYR_PREBUILT_EXECUTABLE} by
772-
# gen_handles.py
773-
add_custom_command(
774-
OUTPUT dev_handles.c
775-
COMMAND
776-
${PYTHON_EXECUTABLE}
777-
${ZEPHYR_BASE}/scripts/gen_handles.py
778-
--output-source dev_handles.c
779-
--kernel $<TARGET_FILE:${ZEPHYR_PREBUILT_EXECUTABLE}>
780-
--zephyr-base ${ZEPHYR_BASE}
781-
DEPENDS ${ZEPHYR_PREBUILT_EXECUTABLE}
782-
)
783-
set_property(GLOBAL APPEND PROPERTY GENERATED_KERNEL_SOURCE_FILES dev_handles.c)
771+
if(CONFIG_HAS_DTS)
772+
# dev_handles.c is generated from ${ZEPHYR_PREBUILT_EXECUTABLE} by
773+
# gen_handles.py
774+
add_custom_command(
775+
OUTPUT dev_handles.c
776+
COMMAND
777+
${PYTHON_EXECUTABLE}
778+
${ZEPHYR_BASE}/scripts/gen_handles.py
779+
--output-source dev_handles.c
780+
--kernel $<TARGET_FILE:${ZEPHYR_PREBUILT_EXECUTABLE}>
781+
--zephyr-base ${ZEPHYR_BASE}
782+
DEPENDS ${ZEPHYR_PREBUILT_EXECUTABLE}
783+
)
784+
set_property(GLOBAL APPEND PROPERTY GENERATED_KERNEL_SOURCE_FILES dev_handles.c)
785+
endif()
784786

785787
if(CONFIG_CODE_DATA_RELOCATION)
786788
# @Intent: Linker script to relocate .text, data and .bss sections

0 commit comments

Comments
 (0)