[Lldb-commits] [lldb] r212482 - CMake: Let LLDB build with CMake 3

David Majnemer david.majnemer at gmail.com
Mon Jul 7 13:29:00 PDT 2014


Author: majnemer
Date: Mon Jul  7 15:29:00 2014
New Revision: 212482

URL: http://llvm.org/viewvc/llvm-project?rev=212482&view=rev
Log:
CMake: Let LLDB build with CMake 3

Teach add_lldb_library to correctly use the CMake 2.8.12
PUBLIC/PRIVATE/INTERFACE keywords.  LLDB's CMake configuration would
inconsistently apply these keywords; this was previously a warning in
CMake 2.x but became an error in CMake 3.

Modified:
    lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=212482&r1=212481&r2=212482&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Jul  7 15:29:00 2014
@@ -226,7 +226,7 @@ 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")
+  if (CMAKE_VERSION VERSION_LESS 2.8.12)
     set(cmake_2_8_12_INTERFACE)
     set(cmake_2_8_12_PRIVATE)
     set(cmake_2_8_12_PUBLIC)
@@ -236,19 +236,25 @@ macro(add_lldb_library name)
     set(cmake_2_8_12_PUBLIC PUBLIC)
   endif ()
 
+  if ("${libkind}" STREQUAL "STATIC")
+    set(lldb_library_keyword ${cmake_2_8_12_INTERFACE})
+  else ()
+    set(lldb_library_keyword ${cmake_2_8_12_PUBLIC})
+  endif ()
+
   if(LLDB_USED_LIBS)
     # The Darwin linker doesn't understand --start-group/--end-group.
     if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
-      target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+      target_link_libraries(${name} ${lldb_library_keyword}
                             -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
     else()
-      target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${LLDB_USED_LIBS})
+      target_link_libraries(${name} ${lldb_library_keyword} ${LLDB_USED_LIBS})
     endif()
   endif()
-  target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${CLANG_USED_LIBS})
-  target_link_libraries(${name} ${LLVM_USED_LIBS})
+  target_link_libraries(${name} ${lldb_library_keyword} ${CLANG_USED_LIBS})
+  target_link_libraries(${name} ${lldb_library_keyword} ${LLVM_USED_LIBS})
   llvm_config(${name} ${LLVM_LINK_COMPONENTS})
-  target_link_libraries(${name} ${LLVM_COMMON_LIBS})
+  target_link_libraries(${name} ${lldb_library_keyword} ${LLVM_COMMON_LIBS})
   if (LLVM_COMMON_DEPENDS)
     add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
   endif()





More information about the lldb-commits mailing list