diff options
Diffstat (limited to 'cmake/CompilerWarnings.cmake')
-rw-r--r-- | cmake/CompilerWarnings.cmake | 6 |
1 files 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($<$<COMPILE_LANGUAGE:C>:-Wno-pointer-sign>) ENDIF(SUPPORT_WPOINTER_SIGN) IF(SUPPORT_WSTRICT_PROTOTYPES) - ADD_COMPILE_OPTIONS("-Wstrict-prototypes") + # only valid for C + ADD_COMPILE_OPTIONS($<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes>) ENDIF(SUPPORT_WSTRICT_PROTOTYPES) IF(SUPPORT_WSTRICT_ALIASING) ADD_COMPILE_OPTIONS("-Wno-strict-aliasing") |