diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 07b8f228f..3279b761f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -655,12 +655,13 @@ ENDIF(LIBUTIL_LIBRARY) # Process with warn flags SET(CMAKE_C_WARN_FLAGS "") CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) -CHECK_C_COMPILER_FLAG(-Wall SUPPORT_W) +CHECK_C_COMPILER_FLAG(-W SUPPORT_W) CHECK_C_COMPILER_FLAG(-Wpointer-arith SUPPORT_WPOINTER) CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WPARAM) CHECK_C_COMPILER_FLAG(-Wno-unused-function SUPPORT_WFUNCTION) CHECK_C_COMPILER_FLAG(-Wunused-variable SUPPORT_WUNUSED_VAR) CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN) +CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES) CHECK_C_COMPILER_FLAG(-pedantic SUPPORT_PEDANTIC_FLAG) CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG) IF(SUPPORT_W) @@ -684,6 +685,9 @@ ENDIF(SUPPORT_WUNUSED_VAR) IF(SUPPORT_WPOINTER_SIGN) SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign") ENDIF(SUPPORT_WPOINTER_SIGN) +IF(SUPPORT_WSTRICT_PROTOTYPES) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wstrict-prototypes") +ENDIF(SUPPORT_WSTRICT_PROTOTYPES) IF(SUPPORT_PEDANTIC_FLAG) SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -pedantic") ENDIF(SUPPORT_PEDANTIC_FLAG) @@ -694,9 +698,9 @@ ENDIF(SUPPORT_STD_FLAG) # Optimization flags IF(NOT CMAKE_C_OPT_FLAGS) IF(ENABLE_OPTIMIZATION MATCHES "ON") - SET(CMAKE_C_OPT_FLAGS "-O3") + SET(CMAKE_C_OPT_FLAGS "-O3 -fstrict-aliasing") ELSE(ENABLE_OPTIMIZATION MATCHES "ON") - SET(CMAKE_C_OPT_FLAGS "-O0") + SET(CMAKE_C_OPT_FLAGS "-O0 -fstrict-aliasing") ENDIF(ENABLE_OPTIMIZATION MATCHES "ON") ENDIF(NOT CMAKE_C_OPT_FLAGS) |