[Lldb-commits] [lldb] r293686 - [CMake] Add accurate dependency specifications

Chris Bieneman via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 31 12:43:05 PST 2017


Author: cbieneman
Date: Tue Jan 31 14:43:05 2017
New Revision: 293686

URL: http://llvm.org/viewvc/llvm-project?rev=293686&view=rev
Log:
[CMake] Add accurate dependency specifications

Summary:
This patch adds accurate dependency specifications to the mail LLDB libraries and tools.

In all cases except lldb-server, these dependencies are added in addition to existing dependencies (making this low risk), and I performed some code cleanup along the way.

For lldb-server I've cleaned up the LLVM dependencies down to just the minimum actually required. This is more than lldb-server actually directly references, and I've left a todo in the code to clean that up.

Reviewers: labath, zturner

Subscribers: lldb-commits, danalbert, srhines, ki.stfu, mgorny, jgosnell

Differential Revision: https://reviews.llvm.org/D29333

Modified:
    lldb/trunk/source/Breakpoint/CMakeLists.txt
    lldb/trunk/source/Commands/CMakeLists.txt
    lldb/trunk/source/Core/CMakeLists.txt
    lldb/trunk/source/DataFormatters/CMakeLists.txt
    lldb/trunk/source/Expression/CMakeLists.txt
    lldb/trunk/source/Host/CMakeLists.txt
    lldb/trunk/source/Initialization/CMakeLists.txt
    lldb/trunk/source/Interpreter/CMakeLists.txt
    lldb/trunk/source/Symbol/CMakeLists.txt
    lldb/trunk/source/Target/CMakeLists.txt
    lldb/trunk/source/Utility/CMakeLists.txt
    lldb/trunk/tools/argdumper/CMakeLists.txt
    lldb/trunk/tools/debugserver/source/CMakeLists.txt
    lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt
    lldb/trunk/tools/driver/CMakeLists.txt
    lldb/trunk/tools/lldb-mi/CMakeLists.txt
    lldb/trunk/tools/lldb-server/CMakeLists.txt

Modified: lldb/trunk/source/Breakpoint/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/CMakeLists.txt (original)
+++ lldb/trunk/source/Breakpoint/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -20,4 +20,16 @@ add_lldb_library(lldbBreakpoint
   Watchpoint.cpp
   WatchpointList.cpp
   WatchpointOptions.cpp
+
+  LINK_LIBS
+    lldbCore
+    lldbExpression
+    lldbInterpreter
+    lldbSymbol
+    lldbTarget
+    lldbPluginCPlusPlusLanguage
+    lldbPluginObjCLanguage
+
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/source/Commands/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CMakeLists.txt (original)
+++ lldb/trunk/source/Commands/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -29,4 +29,19 @@ add_lldb_library(lldbCommands
   CommandObjectWatchpoint.cpp
   CommandObjectWatchpointCommand.cpp
   CommandObjectLanguage.cpp
+
+  LINK_LIBS
+    lldbBreakpoint
+    lldbCore
+    lldbDataFormatters
+    lldbExpression
+    lldbHost
+    lldbInterpreter
+    lldbSymbol
+    lldbTarget
+    lldbUtility
+    lldbPluginExpressionParserClang
+
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/source/Core/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Core/CMakeLists.txt (original)
+++ lldb/trunk/source/Core/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -69,5 +69,24 @@ add_lldb_library(lldbCore
   ValueObjectSyntheticFilter.cpp
   ValueObjectVariable.cpp
   VMRange.cpp
+
+  LINK_LIBS
+    lldbBreakpoint
+    lldbDataFormatters
+    lldbExpression
+    lldbHost
+    lldbInterpreter
+    lldbSymbol
+    lldbTarget
+    lldbUtility
+    lldbPluginProcessUtility
+    lldbPluginCPlusPlusLanguage
+    lldbPluginObjCLanguage
+    lldbPluginObjectFileJIT
+    lldbPluginExpressionParserClang
+
+  LINK_COMPONENTS
+    Support
+    Demangle
   )
 

Modified: lldb/trunk/source/DataFormatters/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/CMakeLists.txt (original)
+++ lldb/trunk/source/DataFormatters/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -16,4 +16,14 @@ add_lldb_library(lldbDataFormatters
   TypeValidator.cpp
   ValueObjectPrinter.cpp
   VectorType.cpp
+
+  LINK_LIBS
+    lldbCore
+    lldbInterpreter
+    lldbSymbol
+    lldbTarget
+    lldbUtility
+  
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/source/Expression/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Expression/CMakeLists.txt (original)
+++ lldb/trunk/source/Expression/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -21,4 +21,18 @@ add_lldb_library(lldbExpression
 
   DEPENDS
   ${tablegen_deps}
+
+  LINK_LIBS
+    lldbCore
+    lldbHost
+    lldbInterpreter
+    lldbSymbol
+    lldbTarget
+    lldbUtility
+    lldbPluginExpressionParserClang
+
+  LINK_COMPONENTS
+    Core
+    ExecutionEngine
+    Support
   )

Modified: lldb/trunk/source/Host/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Host/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -55,6 +55,10 @@ add_host_subdirectory(posix
   posix/ConnectionFileDescriptorPosix.cpp
   )
 
+if(NOT LLDB_DISABLE_PYTHON)
+  list(APPEND LLDB_PLUGINS lldbPluginScriptInterpreterPython)
+endif()
+
 if (CMAKE_SYSTEM_NAME MATCHES "Windows")
   add_host_subdirectory(windows
     windows/ConnectionGenericFileWindows.cpp
@@ -110,6 +114,7 @@ else()
       macosx/cfcpp/CFCString.cpp
       )
 
+
   elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
     add_host_subdirectory(linux
       linux/AbstractSocket.cpp
@@ -120,6 +125,7 @@ else()
       linux/ProcessLauncherLinux.cpp
       linux/ThisThread.cpp
       )
+    list(APPEND LLDB_PLUGINS lldbPluginProcessLinux)
     if (CMAKE_SYSTEM_NAME MATCHES "Android")
       add_host_subdirectory(android
         android/HostInfoAndroid.cpp
@@ -157,7 +163,20 @@ if (${get_python_libdir})
   endif()
 endif()
 
-add_lldb_library(lldbHost ${HOST_SOURCES})
+add_lldb_library(lldbHost
+  ${HOST_SOURCES}
+  
+  LINK_LIBS
+    lldbCore
+    lldbInterpreter
+    lldbSymbol
+    lldbTarget
+    lldbUtility
+    ${LLDB_PLUGINS}
+  
+  LINK_COMPONENTS
+    Support
+  )
 
 if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
 target_link_libraries(lldbHost kvm)

Modified: lldb/trunk/source/Initialization/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Initialization/CMakeLists.txt (original)
+++ lldb/trunk/source/Initialization/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -1,5 +1,36 @@
+if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
+  list(APPEND EXTRA_PLUGINS lldbPluginObjectFileMachO)
+endif()
+
+if ( CMAKE_SYSTEM_NAME MATCHES "Linux|Android|FreeBSD|NetBSD" )
+  list(APPEND EXTRA_PLUGINS lldbPluginProcessPOSIX)
+endif()
+
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+  list(APPEND LLDB_USED_LIBS
+    lldbPluginProcessWindowsCommon
+    ws2_32
+    rpcrt4
+    )
+endif ()
+
 add_lldb_library(lldbInitialization
   SystemInitializerCommon.cpp
   SystemInitializer.cpp
   SystemLifetimeManager.cpp
+
+  LINK_LIBS
+    lldbCore
+    lldbHost
+    lldbPluginInstructionARM
+    lldbPluginInstructionMIPS
+    lldbPluginInstructionMIPS64
+    lldbPluginObjectContainerBSDArchive
+    lldbPluginObjectContainerMachOArchive
+    lldbPluginObjectFileELF
+    lldbPluginObjectFilePECOFF
+    lldbPluginProcessGDBRemote
+    ${EXTRA_PLUGINS}
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/source/Interpreter/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CMakeLists.txt (original)
+++ lldb/trunk/source/Interpreter/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -43,4 +43,15 @@ add_lldb_library(lldbInterpreter
   Options.cpp
   Property.cpp
   ScriptInterpreter.cpp
+
+  LINK_LIBS
+    lldbCommands
+    lldbCore
+    lldbDataFormatters
+    lldbHost
+    lldbTarget
+    lldbUtility
+
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/source/Symbol/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CMakeLists.txt (original)
+++ lldb/trunk/source/Symbol/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -36,4 +36,25 @@ add_lldb_library(lldbSymbol
   Variable.cpp
   VariableList.cpp
   VerifyDecl.cpp
+
+  LINK_LIBS
+    clangAST
+    clangBasic
+    clangFrontend
+    lldbCore
+    lldbDataFormatters
+    lldbExpression
+    lldbHost
+    lldbTarget
+    lldbUtility
+    lldbPluginExpressionParserClang
+    lldbPluginExpressionParserGo
+    lldbPluginSymbolFileDWARF
+    lldbPluginSymbolFilePDB
+    lldbPluginObjectContainerBSDArchive
+    lldbPluginCPlusPlusLanguage
+    lldbPluginObjCLanguage
+
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/source/Target/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Target/CMakeLists.txt (original)
+++ lldb/trunk/source/Target/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -58,4 +58,20 @@ add_lldb_library(lldbTarget
   ThreadSpec.cpp
   UnixSignals.cpp
   UnwindAssembly.cpp
+
+  LINK_LIBS
+    lldbBreakpoint
+    lldbCore
+    lldbExpression
+    lldbHost
+    lldbInterpreter
+    lldbSymbol
+    lldbUtility
+    lldbPluginExpressionParserClang
+    lldbPluginCPlusPlusLanguage
+    lldbPluginObjCLanguage
+    lldbPluginProcessUtility
+
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/source/Utility/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/source/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Utility/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -16,4 +16,12 @@ add_lldb_library(lldbUtility
   StringLexer.cpp
   TaskPool.cpp
   UriParser.cpp
+
+  LINK_LIBS
+    lldbCore
+    lldbHost
+    lldbTarget
+
+  LINK_COMPONENTS
+    Support
   )

Modified: lldb/trunk/tools/argdumper/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/argdumper/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/tools/argdumper/CMakeLists.txt (original)
+++ lldb/trunk/tools/argdumper/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -2,12 +2,9 @@ include(${LLDB_PROJECT_ROOT}/cmake/LLDBD
 
 add_lldb_tool(lldb-argdumper INCLUDE_IN_FRAMEWORK
   argdumper.cpp
-  )
 
-if (LLDB_LINKER_SUPPORTS_GROUPS)
-  target_link_libraries(lldb-argdumper -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
-else()
-  target_link_libraries(lldb-argdumper ${LLDB_USED_LIBS})
-endif()
-llvm_config(lldb-argdumper ${LLVM_LINK_COMPONENTS})
+  LINK_LIBS
+    lldbCore
+    lldbUtility
+  )
 

Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -33,7 +33,12 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwi
     )
 endif ()
 
-add_library(lldbDebugserverCommon
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+  find_library(COCOA_LIBRARY Cocoa)
+  add_subdirectory(MacOSX)
+endif()
+
+add_lldb_library(lldbDebugserverCommon
   debugserver.cpp
   DNBArch.cpp
   DNBBreakpoint.cpp
@@ -58,11 +63,13 @@ add_library(lldbDebugserverCommon
   RNBSocket.cpp
   SysSignal.cpp
   TTYState.cpp
+
+  LINK_LIBS
+    lldbHost
+    ${COCOA_LIBRARY}
   )
 
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  find_library(COCOA_LIBRARY Cocoa)
-  target_link_libraries(lldbDebugserverCommon ${COCOA_LIBRARY})
-  add_subdirectory(MacOSX)
-endif()
+
+
+
 

Modified: lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -28,14 +28,6 @@ add_custom_command(OUTPUT ${DEBUGSERVER_
           ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj
   )
 
-set(DEBUGSERVER_USED_LIBS
-  lldbDebugserverCommon
-  lldbUtility
-  lldbDebugserverMacOSX_I386
-  lldbDebugserverMacOSX_X86_64
-  lldbDebugserverMacOSX_DarwinLog
-  )
-
 add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK
   HasAVX.s
   CFBundle.cpp
@@ -51,6 +43,12 @@ add_lldb_tool(debugserver INCLUDE_IN_FRA
   OsLogger.cpp
   ${generated_mach_interfaces}
   ${DEBUGSERVER_VERS_GENERATED_FILE}
+
+  LINK_LIBS
+    lldbDebugserverCommon
+    lldbDebugserverMacOSX_I386
+    lldbDebugserverMacOSX_X86_64
+    lldbDebugserverMacOSX_DarwinLog
   )
 
 set_source_files_properties(
@@ -59,8 +57,6 @@ set_source_files_properties(
   PROPERTIES LANGUAGE C COMPILE_FLAGS "-x assembler-with-cpp"
   )
 
-target_link_libraries(debugserver ${DEBUGSERVER_USED_LIBS})
-
 set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
   CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
 if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL ""))

Modified: lldb/trunk/tools/driver/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/tools/driver/CMakeLists.txt (original)
+++ lldb/trunk/tools/driver/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -1,8 +1,25 @@
 include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
 
+if ((CMAKE_SYSTEM_NAME MATCHES "Windows") OR
+    (CMAKE_SYSTEM_NAME MATCHES "NetBSD" ))
+  # These targets do not have getopt support, so they rely on the one provided by
+  # liblldb. However, getopt is not a part of the liblldb interface, so we have
+  # to link against the constituent libraries manually. Note that this is
+  # extremely scary as it introduces ODR violations, and it should go away as
+  # soon as possible.
+  set(host_lib lldbHost)
+endif()
+
 add_lldb_tool(lldb
   Driver.cpp
   Platform.cpp
+
+  LINK_LIBS
+    liblldb
+    ${host_lib}
+
+  LINK_COMPONENTS
+    Support
   )
 
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
@@ -19,16 +36,5 @@ if ( LLDB_CAN_USE_DEBUGSERVER )
   add_dependencies(lldb debugserver)
 endif()
 
-target_link_libraries(lldb liblldb)
-if ((CMAKE_SYSTEM_NAME MATCHES "Windows") OR
-    (CMAKE_SYSTEM_NAME MATCHES "NetBSD" ))
-  # These targets do not have getopt support, so they rely on the one provided by
-  # liblldb. However, getopt is not a part of the liblldb interface, so we have
-  # to link against the constituent libraries manually. Note that this is
-  # extremely scary as it introduces ODR violations, and it should go away as
-  # soon as possible.
-  target_link_libraries(lldb ${LLDB_USED_LIBS})
-endif()
-
 set_target_properties(lldb PROPERTIES VERSION ${LLDB_VERSION})
 

Modified: lldb/trunk/tools/lldb-mi/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-mi/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -1,4 +1,16 @@
-set(LLDB_MI_SOURCES
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
+  add_definitions( -DIMPORT_LIBLLDB )
+  list(APPEND extra_libs lldbHost)
+endif ()
+
+if (HAVE_LIBPTHREAD)
+  list(APPEND extra_libs pthread)
+endif ()
+
+# We need to include the llvm components we depend on manually, as liblldb does
+# not re-export those.
+set(LLVM_LINK_COMPONENTS Support)
+add_lldb_tool(lldb-mi
   MICmdArgContext.cpp
   MICmdArgSet.cpp
   MICmdArgValBase.cpp
@@ -72,23 +84,14 @@ set(LLDB_MI_SOURCES
   MIUtilString.cpp
   MIUtilThreadBaseStd.cpp
   MIUtilVariant.cpp
-  )
 
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
-  add_definitions( -DIMPORT_LIBLLDB )
-  list(APPEND LLDB_MI_SOURCES
-    ${LLDB_SOURCE_ROOT}/Host/common/GetOptInc.cpp
-    )
-endif ()
-
-# We need to include the llvm components we depend on manually, as liblldb does
-# not re-export those.
-set(LLVM_LINK_COMPONENTS Support)
-add_lldb_tool(lldb-mi ${LLDB_MI_SOURCES})
+  LINK_LIBS
+    liblldb
+    ${host_lib}
+    ${extra_libs}
 
-target_link_libraries(lldb-mi liblldb)
-if (HAVE_LIBPTHREAD)
-  target_link_libraries(lldb-mi pthread)
-endif ()
+  LINK_COMPONENTS
+    Support
+  )
 
 set_target_properties(lldb-mi PROPERTIES VERSION ${LLDB_VERSION})

Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=293686&r1=293685&r2=293686&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Tue Jan 31 14:43:05 2017
@@ -23,90 +23,6 @@ endif ()
 
 include_directories(../../source)
 
-
-set( LLDB_USED_LIBS
-  lldbBase
-  lldbBreakpoint
-  lldbCommands
-  lldbDataFormatters
-  lldbHost
-  lldbCore
-  lldbExpression
-  lldbInitialization
-  lldbInterpreter
-  lldbSymbol
-  lldbTarget
-  lldbUtility
-
-  # Plugins
-  lldbPluginDisassemblerLLVM
-  lldbPluginSymbolFileDWARF
-  lldbPluginSymbolFilePDB
-  lldbPluginSymbolFileSymtab
-  lldbPluginDynamicLoaderPosixDYLD
-
-  lldbPluginCPlusPlusLanguage
-  lldbPluginGoLanguage
-  lldbPluginJavaLanguage
-  lldbPluginObjCLanguage
-  lldbPluginObjCPlusPlusLanguage
-  lldbPluginOCamlLanguage
-
-  lldbPluginObjectFileELF
-  lldbPluginObjectFileJIT
-  lldbPluginSymbolVendorELF
-  lldbPluginPlatformPOSIX
-  lldbPluginObjectContainerBSDArchive
-  lldbPluginObjectContainerMachOArchive
-  lldbPluginProcessGDBRemote
-  lldbPluginProcessUtility
-  lldbPluginObjectContainerMachOArchive
-  lldbPluginObjectContainerBSDArchive
-  lldbPluginPlatformMacOSX
-  lldbPluginUnwindAssemblyInstEmulation
-  lldbPluginUnwindAssemblyX86
-  lldbPluginAppleObjCRuntime
-  lldbPluginCXXItaniumABI
-  lldbPluginInstructionARM
-  lldbPluginInstructionARM64
-  lldbPluginInstructionMIPS
-  lldbPluginInstructionMIPS64
-  lldbPluginObjectFilePECOFF
-  lldbPluginExpressionParserClang
-  lldbPluginExpressionParserGo
-  )
-
-# Linux-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "Linux|Android" )
-  list(APPEND LLDB_USED_LIBS
-    lldbPluginProcessLinux
-    lldbPluginProcessPOSIX
-   )
-endif ()
-
-# Darwin-only libraries
-if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
-  list(APPEND LLDB_USED_LIBS
-    lldbPluginObjectFileMachO
-    )
-endif()
-
-set( CLANG_USED_LIBS
-  clangAnalysis
-  clangAST
-  clangBasic
-  clangCodeGen
-  clangDriver
-  clangEdit
-  clangFrontend
-  clangLex
-  clangParse
-  clangRewrite
-  clangRewriteFrontend
-  clangSema
-  clangSerialization
-  )
-
 set(LLDB_SYSTEM_LIBS)
 if (NOT LLDB_DISABLE_LIBEDIT)
   list(APPEND LLDB_SYSTEM_LIBS edit)
@@ -142,54 +58,25 @@ if (LLVM_BUILD_STATIC)
   endif()
 endif()
 
-set(LLVM_LINK_COMPONENTS
-  ${LLVM_TARGETS_TO_BUILD}
-  interpreter
-  asmparser
-  bitreader
-  bitwriter
-  codegen
-  demangle
-  ipo
-  selectiondag
-  bitreader
-  mc
-  mcjit
-  core
-  mcdisassembler
-  executionengine
-  runtimedyld
-  option
-  support
-  coverage
-  target
-  )
-
 add_lldb_tool(lldb-server INCLUDE_IN_FRAMEWORK
     Acceptor.cpp
     lldb-gdbserver.cpp
     lldb-platform.cpp
     lldb-server.cpp
     LLDBServerUtilities.cpp
-)
 
-# The Darwin linker doesn't understand --start-group/--end-group.
-if (LLDB_LINKER_SUPPORTS_GROUPS)
-  target_link_libraries(lldb-server
-                        -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
-  target_link_libraries(lldb-server
-                        -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
-else()
-  target_link_libraries(lldb-server ${LLDB_USED_LIBS})
-  target_link_libraries(lldb-server ${CLANG_USED_LIBS})
-endif()
-if(NOT LLVM_LINK_LLVM_DYLIB)
-  # This is necessary in !LLVM_LINK_LLVM_DYLIB as LLDB's libs do not track their
-  # dependencies properly. It is conditional because in a LLVM_LINK_LLVM_DYLIB
-  # build it would introduce duplicate symbols (add_lldb_tool links to libLLVM,
-  # and this would add the individual .a files as well).
-  llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
-endif()
+    LINK_LIBS
+      lldbBase
+      lldbCore
+      lldbHost
+      lldbInitialization
+      lldbInterpreter
+      ${LLDB_SYSTEM_LIBS}
+
+    LINK_COMPONENTS
+      Support
+      MCJIT # TODO: Remove this after the plugins are updated
+)
 
 target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
 




More information about the lldb-commits mailing list