From c2974e22d4cad96734af02c5e1e4ed9c390b21ab Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Fri, 9 Sep 2022 15:07:04 +0200 Subject: [PATCH] cmake: test format options together Fixes: #47588 Use `check_set_compiler_property(... "SHELL:-Wformat -W")` to ensure that compiler options requiring `-Wformat` to work properly are tested with said option. Signed-off-by: Torsten Rasmussen --- cmake/compiler/gcc/compiler_flags.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/compiler/gcc/compiler_flags.cmake b/cmake/compiler/gcc/compiler_flags.cmake index e8deb696152..a02d5f24967 100644 --- a/cmake/compiler/gcc/compiler_flags.cmake +++ b/cmake/compiler/gcc/compiler_flags.cmake @@ -28,9 +28,8 @@ set_compiler_property(PROPERTY optimization_size -Os) # GCC Option standard warning base in Zephyr check_set_compiler_property(PROPERTY warning_base -Wall - -Wformat - -Wformat-security - -Wno-format-zero-length + "SHELL:-Wformat -Wformat-security" + "SHELL:-Wformat -Wno-format-zero-length" -Wno-main )