summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-03-11 03:08:53 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-03-11 03:08:53 +0000
commitefbf8367e63b62d55a9a3f3474b8b973c4aa6c52 (patch)
treedd67c38a4c3023355be1aae32707067be4605322
parent12390847fb039af8c2a7fa7b23c0f5ce70cf6a33 (diff)
downloadbcm5719-llvm-efbf8367e63b62d55a9a3f3474b8b973c4aa6c52.tar.gz
bcm5719-llvm-efbf8367e63b62d55a9a3f3474b8b973c4aa6c52.zip
build: use LLVM build routines
Check if the compiler actually supports the flags that are being added. Previously, the compiler flags would be used improperly push the flags to the compiler. Particularly, on Darwin, the option would be pushed to the compiler even if it does not support it. llvm-svn: 203532
-rw-r--r--lldb/CMakeLists.txt22
1 files changed, 10 insertions, 12 deletions
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index f85cc2d6725..4cc4566890d 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -126,19 +126,17 @@ elseif (MSVC_VERSION LESS 1700)
"required to build lldb.")
endif()
-# Disable Clang warnings
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- add_lldb_definitions(
- -Wno-deprecated-declarations # Suppress "deprecated auto_ptr" warnings
- )
-endif()
+# Disable GCC warnings
+check_cxx_compiler_flag("-Wno-deprecated-declarations"
+ CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS)
+append_if(CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS
+ "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
-if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
- AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.3")
- add_lldb_definitions(
- -Wno-deprecated-register # Suppress "deprecated register keyword" warnings
- )
-endif()
+# Disable Clang warnings
+check_cxx_compiler_flag("-Wno-deprecated-register"
+ CXX_SUPPORTS_NO_DEPRECATED_REGISTER)
+append_if(CXX_SUPPORTS_NO_DEPRECATED_REGISTER
+ "-Wno-deprecated-register" CMAKE_CXX_FLAGS)
# Disable MSVC warnings
if( MSVC )
OpenPOWER on IntegriCloud