aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-18 14:47:57 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-18 14:47:57 +0000
commit9df3fafe8b0a67969608151778e13ff3f21d70f1 (patch)
treeac696041d6fc79e672b6a9b6647a707c8e6d0123
parentf515b2268f829adfbfdb751f54d102b53ed0285c (diff)
Make the GCC warning flags passed by CMake the same as the warning flags passed in the make build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82221 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 150daf4e1e..9ce07692aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,13 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
${CLANG_VERSION_DATA})
message(STATUS "Clang version: ${CLANG_VERSION}")
+# Add appropriate flags for GCC
+if (CMAKE_COMPILER_IS_GNUCXX)
+ # FIXME: Turn off exceptions, RTTI:
+ # -fno-exceptions -fno-rtti
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
+endif ()
+
macro(add_clang_library name)
set(srcs ${ARGN})
if(MSVC_IDE OR XCODE)