[Lldb-commits] [lldb] r206850 - build: use keyword signatures for link dependencies

Saleem Abdulrasool compnerd at compnerd.org
Mon Apr 21 20:18:34 PDT 2014


Author: compnerd
Date: Mon Apr 21 22:18:34 2014
New Revision: 206850

URL: http://llvm.org/viewvc/llvm-project?rev=206850&view=rev
Log:
build: use keyword signatures for link dependencies

This updates the target_link_libraries invocation when building with CMake
2.8.12 or newer.  The newer version of CMake warns when keyword and plain
signatures are used for target_link_libraries.  This addresses that difference
while maintaining compatibility with the older releases by defining a macro for
the keyword that is defined based on the current version of CMake.

Patch originally by chapuni!

Modified:
    lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=206850&r1=206849&r2=206850&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Apr 21 22:18:34 2014
@@ -205,14 +205,27 @@ macro(add_lldb_library name)
   ##add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
   #endif()
 
+  if (CMAKE_VERSION VERSION_LESS 2.8.12 OR NOT "${libkind}" STREQUAL "STATIC")
+    set(cmake_2_8_12_INTERFACE)
+    set(cmake_2_8_12_PRIVATE)
+    set(cmake_2_8_12_PUBLIC)
+  else ()
+    set(cmake_2_8_12_INTERFACE INTERFACE)
+    set(cmake_2_8_12_PRIVATE PRIVATE)
+    set(cmake_2_8_12_PUBLIC PUBLIC)
+  endif ()
+
   if(LLDB_USED_LIBS)
-    if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Windows")
-      target_link_libraries(${name} -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
+    if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR
+        CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR
+        CMAKE_SYSTEM_NAME MATCHES "Windows")
+      target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+                            -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
     else()
-      target_link_libraries(${name} ${LLDB_USED_LIBS})
+      target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${LLDB_USED_LIBS})
     endif()
   endif()
-  target_link_libraries(${name} ${CLANG_USED_LIBS})
+  target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${CLANG_USED_LIBS})
   target_link_libraries(${name} ${LLVM_USED_LIBS})
   llvm_config(${name} ${LLVM_LINK_COMPONENTS})
   target_link_libraries(${name} ${LLVM_COMMON_LIBS})





More information about the lldb-commits mailing list