aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2019-10-04 12:03:03 +0000
committerMichal Gorny <mgorny@gentoo.org>2019-10-04 12:03:03 +0000
commitcd89ec10e3c672c4741738c5ecde5d9dee297242 (patch)
treeb7ef395c7d03dd18d16fe1c236067b573f7ccc1b
parent7d24ddf8dbe04a1ecdd21eb0f3288f6d79f9b1c1 (diff)
downloadlldb-cd89ec10e3c672c4741738c5ecde5d9dee297242.tar.gz
[lldb] [cmake] Support linking against clang-cpp dylib
Link against clang-cpp dylib rather than split libs when CLANG_LINK_CLANG_DYLIB is enabled. Differential Revision: https://reviews.llvm.org/D68456 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@373734 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/modules/AddLLDB.cmake15
-rw-r--r--source/Core/CMakeLists.txt4
-rw-r--r--source/Plugins/ExpressionParser/Clang/CMakeLists.txt19
-rw-r--r--source/Plugins/Language/ObjC/CMakeLists.txt3
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt3
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt3
-rw-r--r--source/Plugins/Platform/MacOSX/CMakeLists.txt3
-rw-r--r--source/Plugins/SymbolFile/DWARF/CMakeLists.txt5
-rw-r--r--source/Plugins/SymbolFile/NativePDB/CMakeLists.txt5
-rw-r--r--source/Plugins/SymbolFile/PDB/CMakeLists.txt7
-rw-r--r--source/Symbol/CMakeLists.txt8
-rw-r--r--tools/lldb-instr/CMakeLists.txt2
12 files changed, 50 insertions, 27 deletions
diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
index a0b007c23..c6a797927 100644
--- a/cmake/modules/AddLLDB.cmake
+++ b/cmake/modules/AddLLDB.cmake
@@ -37,7 +37,7 @@ function(add_lldb_library name)
cmake_parse_arguments(PARAM
"MODULE;SHARED;STATIC;OBJECT;PLUGIN"
"INSTALL_PREFIX;ENTITLEMENTS"
- "EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
+ "EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS;CLANG_LIBS"
${ARGN})
llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
list(APPEND LLVM_LINK_COMPONENTS ${PARAM_LINK_COMPONENTS})
@@ -91,6 +91,12 @@ function(add_lldb_library name)
${pass_ENTITLEMENTS}
${pass_NO_INSTALL_RPATH}
)
+
+ if(CLANG_LINK_CLANG_DYLIB)
+ target_link_libraries(${name} PRIVATE clang-cpp)
+ else()
+ target_link_libraries(${name} PRIVATE ${PARAM_CLANG_LIBS})
+ endif()
endif()
if(PARAM_SHARED)
@@ -136,7 +142,7 @@ function(add_lldb_executable name)
cmake_parse_arguments(ARG
"GENERATE_INSTALL"
"INSTALL_PREFIX;ENTITLEMENTS"
- "LINK_LIBS;LINK_COMPONENTS"
+ "LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS"
${ARGN}
)
@@ -156,6 +162,11 @@ function(add_lldb_executable name)
)
target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS})
+ if(CLANG_LINK_CLANG_DYLIB)
+ target_link_libraries(${name} PRIVATE clang-cpp)
+ else()
+ target_link_libraries(${name} PRIVATE ${ARG_CLANG_LIBS})
+ endif()
set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
if(ARG_GENERATE_INSTALL)
diff --git a/source/Core/CMakeLists.txt b/source/Core/CMakeLists.txt
index e45b5e7c8..f3ce87ae4 100644
--- a/source/Core/CMakeLists.txt
+++ b/source/Core/CMakeLists.txt
@@ -69,7 +69,6 @@ add_lldb_library(lldbCore
clang-tablegen-targets
LINK_LIBS
- clangDriver
lldbBreakpoint
lldbDataFormatters
lldbExpression
@@ -82,6 +81,9 @@ add_lldb_library(lldbCore
lldbPluginObjCLanguage
${LLDB_CURSES_LIBS}
+ CLANG_LIBS
+ clangDriver
+
LINK_COMPONENTS
Support
Demangle
diff --git a/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
index b114ce776..81d9166bb 100644
--- a/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ b/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -27,6 +27,16 @@ add_lldb_library(lldbPluginExpressionParserClang PLUGIN
${tablegen_deps}
LINK_LIBS
+ lldbCore
+ lldbExpression
+ lldbHost
+ lldbInterpreter
+ lldbSymbol
+ lldbTarget
+ lldbUtility
+ lldbPluginCPlusPlusLanguage
+ lldbPluginCPPRuntime
+ CLANG_LIBS
clangAST
clangCodeGen
clangDriver
@@ -38,15 +48,6 @@ add_lldb_library(lldbPluginExpressionParserClang PLUGIN
clangRewriteFrontend
clangSema
clangSerialization
- lldbCore
- lldbExpression
- lldbHost
- lldbInterpreter
- lldbSymbol
- lldbTarget
- lldbUtility
- lldbPluginCPlusPlusLanguage
- lldbPluginCPPRuntime
LINK_COMPONENTS
Core
ExecutionEngine
diff --git a/source/Plugins/Language/ObjC/CMakeLists.txt b/source/Plugins/Language/ObjC/CMakeLists.txt
index afb68d4de..ebb96c299 100644
--- a/source/Plugins/Language/ObjC/CMakeLists.txt
+++ b/source/Plugins/Language/ObjC/CMakeLists.txt
@@ -22,7 +22,6 @@ add_lldb_library(lldbPluginObjCLanguage PLUGIN
NSString.cpp
LINK_LIBS
- clangAST
lldbCore
lldbDataFormatters
lldbExpression
@@ -32,6 +31,8 @@ add_lldb_library(lldbPluginObjCLanguage PLUGIN
lldbUtility
lldbPluginAppleObjCRuntime
lldbPluginClangCommon
+ CLANG_LIBS
+ clangAST
EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS}
)
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
index 29d9ba1f8..bcf324023 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
@@ -9,7 +9,6 @@ add_lldb_library(lldbPluginAppleObjCRuntime PLUGIN
AppleObjCTypeEncodingParser.cpp
LINK_LIBS
- clangAST
lldbBreakpoint
lldbCore
lldbExpression
@@ -20,6 +19,8 @@ add_lldb_library(lldbPluginAppleObjCRuntime PLUGIN
lldbUtility
lldbPluginExpressionParserClang
lldbPluginCPPRuntime
+ CLANG_LIBS
+ clangAST
LINK_COMPONENTS
Support
)
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
index 1a6c49946..c122e09e8 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
@@ -13,7 +13,6 @@ add_lldb_library(lldbPluginRenderScriptRuntime PLUGIN
${tablegen_deps}
LINK_LIBS
- clangBasic
lldbBreakpoint
lldbCore
lldbDataFormatters
@@ -22,6 +21,8 @@ add_lldb_library(lldbPluginRenderScriptRuntime PLUGIN
lldbInterpreter
lldbSymbol
lldbTarget
+ CLANG_LIBS
+ clangBasic
LINK_COMPONENTS
Core
IRReader
diff --git a/source/Plugins/Platform/MacOSX/CMakeLists.txt b/source/Plugins/Platform/MacOSX/CMakeLists.txt
index 49084dc6d..d5a84d87f 100644
--- a/source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ b/source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -39,7 +39,6 @@ add_lldb_library(lldbPluginPlatformMacOSX PLUGIN
${PLUGIN_PLATFORM_MACOSX_SOURCES}
LINK_LIBS
- clangBasic
lldbBreakpoint
lldbCore
lldbHost
@@ -49,6 +48,8 @@ add_lldb_library(lldbPluginPlatformMacOSX PLUGIN
lldbUtility
lldbPluginPlatformPOSIX
${OBJC_LIBS}
+ CLANG_LIBS
+ clangBasic
LINK_COMPONENTS
Support
)
diff --git a/source/Plugins/SymbolFile/DWARF/CMakeLists.txt b/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
index 1107e531e..4a3bc81af 100644
--- a/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
+++ b/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
@@ -43,8 +43,6 @@ add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
UniqueDWARFASTType.cpp
LINK_LIBS
- clangAST
- clangBasic
lldbCore
lldbExpression
lldbHost
@@ -55,6 +53,9 @@ add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
lldbPluginObjCLanguage
lldbPluginCPlusPlusLanguage
lldbPluginExpressionParserClang
+ CLANG_LIBS
+ clangAST
+ clangBasic
LINK_COMPONENTS
DebugInfoDWARF
Support
diff --git a/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt b/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
index 52b431db5..aaecec476 100644
--- a/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
+++ b/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
@@ -11,11 +11,12 @@ add_lldb_library(lldbPluginSymbolFileNativePDB PLUGIN
UdtRecordCompleter.cpp
LINK_LIBS
- clangAST
- clangLex
lldbCore
lldbSymbol
lldbUtility
+ CLANG_LIBS
+ clangAST
+ clangLex
LINK_COMPONENTS
DebugInfoCodeView
DebugInfoPDB
diff --git a/source/Plugins/SymbolFile/PDB/CMakeLists.txt b/source/Plugins/SymbolFile/PDB/CMakeLists.txt
index 64168d056..79bdce427 100644
--- a/source/Plugins/SymbolFile/PDB/CMakeLists.txt
+++ b/source/Plugins/SymbolFile/PDB/CMakeLists.txt
@@ -4,12 +4,13 @@ add_lldb_library(lldbPluginSymbolFilePDB PLUGIN
SymbolFilePDB.cpp
LINK_LIBS
- clangAST
- clangLex
lldbCore
+ lldbPluginSymbolFileNativePDB
lldbSymbol
lldbUtility
- lldbPluginSymbolFileNativePDB
+ CLANG_LIBS
+ clangAST
+ clangLex
LINK_COMPONENTS
DebugInfoPDB
Support
diff --git a/source/Symbol/CMakeLists.txt b/source/Symbol/CMakeLists.txt
index 42ae414b3..ead43accd 100644
--- a/source/Symbol/CMakeLists.txt
+++ b/source/Symbol/CMakeLists.txt
@@ -46,9 +46,6 @@ add_lldb_library(lldbSymbol
${PLATFORM_SOURCES}
LINK_LIBS
- clangAST
- clangBasic
- clangFrontend
lldbCore
lldbExpression
lldbHost
@@ -60,6 +57,11 @@ add_lldb_library(lldbSymbol
lldbPluginObjCLanguage
lldbPluginObjCRuntime
+ CLANG_LIBS
+ clangAST
+ clangBasic
+ clangFrontend
+
LINK_COMPONENTS
Support
)
diff --git a/tools/lldb-instr/CMakeLists.txt b/tools/lldb-instr/CMakeLists.txt
index e3dbeba40..8da453b28 100644
--- a/tools/lldb-instr/CMakeLists.txt
+++ b/tools/lldb-instr/CMakeLists.txt
@@ -1,7 +1,7 @@
add_lldb_tool(lldb-instr
Instrument.cpp
- LINK_LIBS
+ CLANG_LIBS
clangAST
clangBasic
clangCodeGen