Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soc: nordic: handle -include for IAR #81446

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmake/compiler/compiler_flags_template.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,6 @@ set_compiler_property(PROPERTY no_builtin_malloc)
# Compiler flag for defining specs. Used only by gcc, other compilers may keep
# this undefined.
set_compiler_property(PROPERTY specs)

# Compiler flag for defining preinclude files.
set_compiler_property(PROPERTY include_file)
2 changes: 2 additions & 0 deletions cmake/compiler/gcc/compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,5 @@ set_compiler_property(PROPERTY no_builtin -fno-builtin)
set_compiler_property(PROPERTY no_builtin_malloc -fno-builtin-malloc)

set_compiler_property(PROPERTY specs -specs=)

set_compiler_property(PROPERTY include_file -include)
6 changes: 4 additions & 2 deletions soc/nordic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ zephyr_library_sources(
# headers for different SoCs.
set(dt_binding_includes ${DTS_INCLUDE_FILES})
list(FILTER dt_binding_includes INCLUDE REGEX "/dt-bindings/.*\.h$")
list(TRANSFORM dt_binding_includes PREPEND "-include;")

set(include_flag $<TARGET_PROPERTY:compiler,include_file>$<SEMICOLON>)

set_source_files_properties(
validate_binding_headers.c
DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
PROPERTIES COMPILE_OPTIONS "${dt_binding_includes}"
PROPERTIES COMPILE_OPTIONS "${include_flag}$<JOIN:${dt_binding_includes},;${include_flag}>"
)

if(CONFIG_SOC_HAS_TIMING_FUNCTIONS AND NOT CONFIG_BOARD_HAS_TIMING_FUNCTIONS)
Expand Down
Loading