diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-22 14:51:21 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-22 14:51:21 +0000 |
commit | 19258e8ba5904a04eaa09b7559206e87dccf07a2 (patch) | |
tree | 0d3ad48b83ecee0400f37d7b7924e63e0e8034e1 /CMakeLists.txt | |
parent | 99ad35921aa6c1b200b6432c066961f930fce1e1 (diff) |
cmake: Only add -pedantic if LLVM didn't add it. Don't unconditionally add
-Wall -W, since it's already provided by LLVM's cmake config, and that
overrides fixes (such as -Wno-uninitialized) which LLVM's cmake setup may have
provided.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6efcd4a7bd..5d05a4cdb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,7 +137,12 @@ 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") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing") + + # Enable -pedantic for Clang even if it's not enabled for LLVM. + if (NOT LLVM_ENABLE_PEDANTIC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long") + endif () check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG) if( CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG ) |