summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMorné Chamberlain <thefreeman.za@gmail.com>2012-11-24 18:23:55 (GMT)
committerMorné Chamberlain <thefreeman.za@gmail.com>2012-11-24 18:23:55 (GMT)
commitb3ae61f8338fd3b2308de0173c34a329ba46d191 (patch)
tree72c3a159ba5f430a920ebe04057e383f8b155ec1 /CMakeLists.txt
parent089d9ccdce530ebd08dfc4681833cefeff4a7eb9 (diff)
parent79357448ceac5a8657c5be25bd3f02cd3345b934 (diff)
downloadCMake-b3ae61f8338fd3b2308de0173c34a329ba46d191.zip
CMake-b3ae61f8338fd3b2308de0173c34a329ba46d191.tar.gz
CMake-b3ae61f8338fd3b2308de0173c34a329ba46d191.tar.bz2
Merge branch 'master' into sublime-text-2-generator
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea1c033..a67fb6e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -585,6 +585,29 @@ option(CMAKE_STRICT
"Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
mark_as_advanced(CMAKE_STRICT)
+if(NOT CMake_VERSION_IS_RELEASE)
+ if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND
+ NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
+ set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts
+ -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security
+ -Wmissing-format-attribute -fno-common
+ )
+ set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W
+ -Wshadow -Wpointer-arith -Wformat-security
+ )
+
+ foreach(FLAG_LANG C CXX)
+ foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST})
+ if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ")
+ set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}")
+ endif()
+ endforeach()
+ endforeach()
+
+ unset(C_FLAGS_LIST)
+ unset(CXX_FLAGS_LIST)
+ endif()
+endif()
# build the remaining subdirectories
add_subdirectory(Source)