summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2011-06-22 15:00:25 +0100
committerJosé Fonseca <jfonseca@vmware.com>2011-06-22 15:00:25 +0100
commit7d9c63f3e3172d617aa4a3538dff70ca59bf72a2 (patch)
treeed1d512a6bc17f0f9c9e4d959b2aab3f1c52613b /CMakeLists.txt
parent1d8203353ef6e76042e7cd498b549cbdaefe33bb (diff)
Also use -Wall (or equivalent) when compiling the C++ sources.
Although the bulk is C, there are a few C++ sources as well.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a17ef16eb..1015165d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.6)
INCLUDE (CheckCCompilerFlag)
+INCLUDE (CheckCXXCompilerFlag)
INCLUDE (CheckFunctionExists)
INCLUDE (CheckIncludeFile)
@@ -17,11 +18,16 @@ if (NOT MSVC)
IF (C_COMPILER_FLAG_WALL)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
ENDIF (C_COMPILER_FLAG_WALL)
+ CHECK_CXX_COMPILER_FLAG("-Wall" CXX_COMPILER_FLAG_WALL)
+ IF (CXX_COMPILER_FLAG_WALL)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+ ENDIF (CXX_COMPILER_FLAG_WALL)
else (NOT MSVC)
# -Wall or (/Wall) is actually supported by MSVC and would be detected
# by CHECK_C_COMPILER_FLAG above, but is very pedantic, causing
# thousand of warnings when including windows.h.
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W4")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4")
endif (NOT MSVC)
if (WIN32)