Commit 569e595a1bc4361d996f763f87bdc260dae16559

Sam Lantinga 2014-08-17T13:15:09

cmake: add -Wall/-Wshadow to GCC compilation flags

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11aa5e9..fcf7c18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -331,11 +331,15 @@ if(USE_GCC OR USE_CLANG)
 
   check_c_compiler_flag(-Wall HAVE_GCC_WALL)
   if(HAVE_GCC_WALL)
+    list(APPEND EXTRA_CFLAGS "-Wall")
     if(HAIKU)
       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
     endif()
   endif()
-  #check_c_compiler_flag(-Wshadow HAVE_GCC_WSHADOW)
+  check_c_compiler_flag(-Wshadow HAVE_GCC_WSHADOW)
+  if(HAVE_GCC_WSHADOW)
+    list(APPEND EXTRA_CFLAGS "-Wshadow")
+  endif()
 endif()
 
 if(ASSEMBLY)