浏览代码

Enable full warnings and C99

Ioannis Koutras 13 年之前
父节点
当前提交
4a953c90c2
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      CMakeLists.txt

+ 6 - 0
CMakeLists.txt

@@ -9,6 +9,12 @@ include(DefineOptions.cmake)
 include(MacroEnsureOutOfSourceBuild)
 macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
 
+
+if(CMAKE_COMPILER_IS_GNUCC)
+  add_definitions(-std=c99)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wconversion -Wstrict-prototypes")  
+endif(CMAKE_COMPILER_IS_GNUCC)
+
 configure_file (
 	"${PROJECT_SOURCE_DIR}/dmm_config.h.in"
 	"${PROJECT_BINARY_DIR}/dmm_config.h"