Skip to content

Commit 59bf4e7

Browse files
committed
cmake: clang: set no_track_macro_expansion properly
Compiler property no_track_macro_expansion is controlled by CONFIG_COMPILER_TRACK_MACRO_EXPANSION. When that Kconfig is set to Y, clang fails with the following error message: unknown argument: '-ftrack-macro-expansion=0' This commit modifies clang/compiler_flags.cmake so that there is a proper clang compiler option for this flag. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 8720ab7 commit 59bf4e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/compiler/clang/compiler_flags.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ set_compiler_property(PROPERTY linker_script -Wl,-T)
137137
# clang flag for colourful diagnostic messages
138138
set_compiler_property(PROPERTY diagnostic -fcolor-diagnostics)
139139

140+
# clang flag to disable macro backtrace in diagnostics (can't fully disable it, so limit to 1)
141+
set_compiler_property(PROPERTY no_track_macro_expansion "-fmacro-backtrace-limit=1")
142+
140143
set_compiler_property(PROPERTY no_global_merge "-mno-global-merge")
141144

142145
set_compiler_property(PROPERTY specs)

0 commit comments

Comments
 (0)