From 25d8df0b735c6b966b05cc3ce4a8f69cf20b199f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 16 Jan 2020 15:09:46 +0100 Subject: [PATCH] [Minor] do not pass invalid C warnings to C++ flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit cc1plus: warning: command line option ‘-Wno-pointer-sign’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ --- cmake/CompilerWarnings.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index b9bb7ffde..4dd011d98 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -35,10 +35,12 @@ IF(SUPPORT_WUNUSED_VAR) ADD_COMPILE_OPTIONS("-Wunused-variable") ENDIF(SUPPORT_WUNUSED_VAR) IF(SUPPORT_WPOINTER_SIGN) - ADD_COMPILE_OPTIONS("-Wno-pointer-sign") + # only valid for C + ADD_COMPILE_OPTIONS($<$:-Wno-pointer-sign>) ENDIF(SUPPORT_WPOINTER_SIGN) IF(SUPPORT_WSTRICT_PROTOTYPES) - ADD_COMPILE_OPTIONS("-Wstrict-prototypes") + # only valid for C + ADD_COMPILE_OPTIONS($<$:-Wstrict-prototypes>) ENDIF(SUPPORT_WSTRICT_PROTOTYPES) IF(SUPPORT_WSTRICT_ALIASING) ADD_COMPILE_OPTIONS("-Wno-strict-aliasing") -- 2.39.5