From: Christian Göttsche Date: Thu, 16 Jan 2020 14:09:46 +0000 (+0100) Subject: [Minor] do not pass invalid C warnings to C++ flags X-Git-Tag: 2.3~85^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3220%2Fhead;p=thirdparty%2Frspamd.git [Minor] do not pass invalid C warnings to C++ flags 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++ --- diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index b9bb7ffde2..4dd011d988 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")