Skip to content

Commit

Permalink
cmake: Apply COMPILER_WARNINGS_AS_ERRORS also to nativesim runner
Browse files Browse the repository at this point in the history
When COMPILER_WARNINGS_AS_ERRORS is set, let's also have the
native simulator runner (and anything Zephyr requests built with it)
be built with the same option to treat warnings as errors.
Otherwise we will miss those by default in CI.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
  • Loading branch information
aescolar authored and henrikbrixandersen committed Jan 29, 2024
1 parent 084f3cf commit 346997f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/posix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ elseif (CONFIG_NATIVE_LIBRARY)
$<TARGET_PROPERTY:compiler,no_builtin>
)
endif()

if (CONFIG_COMPILER_WARNINGS_AS_ERRORS)
target_compile_options(native_simulator INTERFACE $<TARGET_PROPERTY:compiler,warnings_as_errors>)
endif()
endif()

if(CONFIG_EXTERNAL_LIBC)
Expand Down

0 comments on commit 346997f

Please sign in to comment.