]> granicus.if.org Git - clang/commitdiff
Make the GCC warning flags passed by CMake the same as the warning flags passed in...
authorDouglas Gregor <dgregor@apple.com>
Fri, 18 Sep 2009 14:47:57 +0000 (14:47 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 18 Sep 2009 14:47:57 +0000 (14:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82221 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index 150daf4e1e9fcdf4a052f19b4ace18d613771cbf..9ce07692aa2d13e4192fd0d321714286d976a8f3 100644 (file)
@@ -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)