cmake: Apply COMPILER_WARNINGS_AS_ERRORS also to nativesim runner

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 <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2024-01-25 11:03:05 +01:00 committed by Henrik Brix Andersen
commit 346997f8be

View file

@ -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)