aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-03-02 00:49:47 +0000
committerJordan Rose <jordan_rose@apple.com>2013-03-02 00:49:47 +0000
commit549a292b54d719e0f3c180f5d982d6aa72645fcc (patch)
treea9a6642723a1a84972a7db3b4d06f7ab2ed5b5d2
parent067e9684ac8eb9eb2bf70c4fe7d04a3d9af64404 (diff)
CMake: -Wno-nested-anon-types for Clang.
In LLVM, -pedantic is not set unless LLVM_ENABLE_PEDANTIC is set. However, Clang's CMakeLists.txt unilaterally adds -pedantic to the run line, so we need to disable -Wnested-anon-types explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176393 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc1fed4988..6efcd4a7bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -138,6 +138,11 @@ configure_file(
# Add appropriate flags for GCC
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
+
+ check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
+ if( CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" )
+ endif()
endif ()
if (APPLE)