Added better gcc warnings in Cmake.
authorNicholas Bishop <nicholasbishop@gmail.com>
Wed, 14 Jan 2009 16:40:11 +0000 (16:40 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Wed, 14 Jan 2009 16:40:11 +0000 (16:40 +0000)
CMakeLists.txt

index a593f7623876c22df4fdc974e52b3a57e5c861d9..1c6cd4946cccbadaed6e0e8b3888fa260ea3b26b 100644 (file)
@@ -196,6 +196,9 @@ IF(UNIX)
 
   SET(PLATFORM_LINKFLAGS "-pthread")
 
+  # Better warnings
+  SET(C_WARNINGS "-Wall -Wno-char-subscripts -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wredundant-decls")
+
   INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
 ENDIF(UNIX)
 
@@ -453,7 +456,7 @@ ENDIF(WITH_GAMEENGINE)
 IF(WITH_BULLET)
   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
 ENDIF(WITH_BULLET)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
 
 #-----------------------------------------------------------------------------