cmake: test format options together

Fixes: #47588

Use `check_set_compiler_property(... "SHELL:-Wformat -W<format-option>")`
to ensure that compiler options requiring `-Wformat` to work properly
are tested with said option.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2022-09-09 15:07:04 +02:00 committed by Fabio Baltieri
commit c2974e22d4

View file

@ -28,9 +28,8 @@ set_compiler_property(PROPERTY optimization_size -Os)
# GCC Option standard warning base in Zephyr # GCC Option standard warning base in Zephyr
check_set_compiler_property(PROPERTY warning_base check_set_compiler_property(PROPERTY warning_base
-Wall -Wall
-Wformat "SHELL:-Wformat -Wformat-security"
-Wformat-security "SHELL:-Wformat -Wno-format-zero-length"
-Wno-format-zero-length
-Wno-main -Wno-main
) )