cmake: filter not supported C++ compilation flags

Compilation warnings appears for C++ files, that following
options are not valid:
-ffrestanding,
-Wno-format-zero-length
-Wno-main
-fgnu89-inline
-std-gnu99
Added checks to filter out unsupported flags.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
This commit is contained in:
Jaroslaw Stelter 2022-07-04 17:22:18 +02:00 committed by Fabio Baltieri
commit 69913adc80
4 changed files with 13 additions and 12 deletions

View file

@ -255,7 +255,8 @@ zephyr_compile_options("SHELL: $<TARGET_PROPERTY:compiler,imacros> ${AUTOCONF_H}
if(NOT CONFIG_PICOLIBC)
# @Intent: Set compiler specific flag for bare metal freestanding option
zephyr_compile_options($<TARGET_PROPERTY:compiler,freestanding>)
zephyr_compile_options($<$<COMPILE_LANGUAGE:C>:$<TARGET_PROPERTY:compiler,freestanding>>)
zephyr_compile_options($<$<COMPILE_LANGUAGE:ASM>:$<TARGET_PROPERTY:compiler,freestanding>>)
endif()
# @Intent: Set compiler specific flag for tentative definitions, no-common