From 27e1fd69f987d3082229b3368a87d59ffdcab5a4 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Mon, 7 Sep 2020 08:46:28 +0200 Subject: [PATCH] cmake: c++ compiler flag exclusion, -Werror=implicit-int Fixes: #28097 The compiler warning flag `-Werror=implicit-int` was added using `set_compiler_property()` which will always add the compiler flag if the compiler flag supports it. This has been changed to `check_set_compiler_property()` which will check if the flag is among the list of `CXX_EXCLUDED_OPTIONS`, and only adds the flag if both the compiler supports it, and it is not an excluded option. Signed-off-by: Torsten Rasmussen --- cmake/compiler/arcmwdt/compiler_flags.cmake | 2 +- cmake/compiler/gcc/compiler_flags.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/compiler/arcmwdt/compiler_flags.cmake b/cmake/compiler/arcmwdt/compiler_flags.cmake index f3219ecd37f..9b340729286 100644 --- a/cmake/compiler/arcmwdt/compiler_flags.cmake +++ b/cmake/compiler/arcmwdt/compiler_flags.cmake @@ -104,7 +104,7 @@ check_set_compiler_property(PROPERTY warning_extended -Wno-tautological-compare ) -set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int) +check_set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int) set_compiler_property(PROPERTY warning_error_misra_sane -Werror=vla) diff --git a/cmake/compiler/gcc/compiler_flags.cmake b/cmake/compiler/gcc/compiler_flags.cmake index b7ff02c3d27..a8133f509c1 100644 --- a/cmake/compiler/gcc/compiler_flags.cmake +++ b/cmake/compiler/gcc/compiler_flags.cmake @@ -91,7 +91,7 @@ check_set_compiler_property(APPEND PROPERTY warning_dw_3 set_compiler_property(PROPERTY warning_extended -Wno-unused-but-set-variable) -set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int) +check_set_compiler_property(PROPERTY warning_error_implicit_int -Werror=implicit-int) set_compiler_property(PROPERTY warning_error_misra_sane -Werror=vla)