[Lldb-commits] [lldb] r203532 - build: use LLVM build routines

Saleem Abdulrasool compnerd at compnerd.org
Mon Mar 10 20:08:53 PDT 2014


Author: compnerd
Date: Mon Mar 10 22:08:53 2014
New Revision: 203532

URL: http://llvm.org/viewvc/llvm-project?rev=203532&view=rev
Log:
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.

Modified:
    lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=203532&r1=203531&r2=203532&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Mar 10 22:08:53 2014
@@ -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 )





More information about the lldb-commits mailing list