Cosmetic change: using $<COMPILE_LANGUAGE:>
authorVitaliy Kirsanov <krokoziabla@yandex-team.ru>
Tue, 9 Apr 2019 10:21:07 +0000 (13:21 +0300)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sat, 4 May 2019 01:41:48 +0000 (11:41 +1000)
CMakeLists.txt

index 5619005..21fd9b7 100644 (file)
@@ -80,14 +80,9 @@ add_compile_options(
     $<$<BOOL:${ENABLE_WERROR}>:-Werror>
     $<$<AND:$<BOOL:${HAVE_SSP_FLAG}>,$<BOOL:${ENABLE_SSP}>>:-fstack-protector>
     $<$<AND:$<BOOL:${HAVE_SSP_FLAG}>,$<BOOL:${ENABLE_SSP}>>:--param>
-    $<$<AND:$<BOOL:${HAVE_SSP_FLAG}>,$<BOOL:${ENABLE_SSP}>>:ssp-buffer-size=4>)
-
-if(HAVE_WEFFCXX_FLAG)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++")
-endif()
-if(HAVE_DECL_AFTER_STMT_FLAG)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdeclaration-after-statement")
-endif()
+    $<$<AND:$<BOOL:${HAVE_SSP_FLAG}>,$<BOOL:${ENABLE_SSP}>>:ssp-buffer-size=4>
+    $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:HAVE_WEFFCXX_FLAG>>:-Weffc++>
+    $<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:HAVE_DECL_AFTER_STMT_FLAG>>:-Wdeclaration-after-statement>)
 
 if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND HAVE_STACKREALIGN_FLAG)
     add_compile_options(-mstackrealign)