From: Douglas Gregor Date: Fri, 18 Sep 2009 14:47:57 +0000 (+0000) Subject: Make the GCC warning flags passed by CMake the same as the warning flags passed in... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9df3fafe8b0a67969608151778e13ff3f21d70f1;p=clang 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 --- 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)