mgorny created this revision.
mgorny added reviewers: labath, compnerd, phosek, beanz.
Link against clang-cpp dylib rather than split libs when
CLANG_LINK_CLANG_DYLIB is enabled.
https://reviews.llvm.org/D68456
Files:
lldb/cmake/modules/AddLLDB.cmake
lldb/source/Core/CMakeLists.txt
lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
lldb/source/Plugins/Language/ObjC/CMakeLists.txt
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt
lldb/source/Symbol/CMakeLists.txt
lldb/tools/lldb-instr/CMakeLists.txt
Index: lldb/tools/lldb-instr/CMakeLists.txt
===================================================================
--- lldb/tools/lldb-instr/CMakeLists.txt
+++ lldb/tools/lldb-instr/CMakeLists.txt
@@ -1,7 +1,7 @@
add_lldb_tool(lldb-instr
Instrument.cpp
- LINK_LIBS
+ CLANG_LIBS
clangAST
clangBasic
clangCodeGen
Index: lldb/source/Symbol/CMakeLists.txt
===================================================================
--- lldb/source/Symbol/CMakeLists.txt
+++ lldb/source/Symbol/CMakeLists.txt
@@ -46,9 +46,6 @@
${PLATFORM_SOURCES}
LINK_LIBS
- clangAST
- clangBasic
- clangFrontend
lldbCore
lldbExpression
lldbHost
@@ -60,6 +57,11 @@
lldbPluginObjCLanguage
lldbPluginObjCRuntime
+ CLANG_LIBS
+ clangAST
+ clangBasic
+ clangFrontend
+
LINK_COMPONENTS
Support
)
Index: lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt
+++ lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt
@@ -4,12 +4,13 @@
SymbolFilePDB.cpp
LINK_LIBS
- clangAST
- clangLex
lldbCore
+ lldbPluginSymbolFileNativePDB
lldbSymbol
lldbUtility
- lldbPluginSymbolFileNativePDB
+ CLANG_LIBS
+ clangAST
+ clangLex
LINK_COMPONENTS
DebugInfoPDB
Support
Index: lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
+++ lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
@@ -11,11 +11,12 @@
UdtRecordCompleter.cpp
LINK_LIBS
- clangAST
- clangLex
lldbCore
lldbSymbol
lldbUtility
+ CLANG_LIBS
+ clangAST
+ clangLex
LINK_COMPONENTS
DebugInfoCodeView
DebugInfoPDB
Index: lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
+++ lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
@@ -43,8 +43,6 @@
UniqueDWARFASTType.cpp
LINK_LIBS
- clangAST
- clangBasic
lldbCore
lldbExpression
lldbHost
@@ -55,6 +53,9 @@
lldbPluginObjCLanguage
lldbPluginCPlusPlusLanguage
lldbPluginExpressionParserClang
+ CLANG_LIBS
+ clangAST
+ clangBasic
LINK_COMPONENTS
DebugInfoDWARF
Support
Index: lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -39,7 +39,6 @@
${PLUGIN_PLATFORM_MACOSX_SOURCES}
LINK_LIBS
- clangBasic
lldbBreakpoint
lldbCore
lldbHost
@@ -49,6 +48,8 @@
lldbUtility
lldbPluginPlatformPOSIX
${OBJC_LIBS}
+ CLANG_LIBS
+ clangBasic
LINK_COMPONENTS
Support
)
Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
+++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
@@ -13,7 +13,6 @@
${tablegen_deps}
LINK_LIBS
- clangBasic
lldbBreakpoint
lldbCore
lldbDataFormatters
@@ -22,6 +21,8 @@
lldbInterpreter
lldbSymbol
lldbTarget
+ CLANG_LIBS
+ clangBasic
LINK_COMPONENTS
Core
IRReader
Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
@@ -9,7 +9,6 @@
AppleObjCTypeEncodingParser.cpp
LINK_LIBS
- clangAST
lldbBreakpoint
lldbCore
lldbExpression
@@ -20,6 +19,8 @@
lldbUtility
lldbPluginExpressionParserClang
lldbPluginCPPRuntime
+ CLANG_LIBS
+ clangAST
LINK_COMPONENTS
Support
)
Index: lldb/source/Plugins/Language/ObjC/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Language/ObjC/CMakeLists.txt
+++ lldb/source/Plugins/Language/ObjC/CMakeLists.txt
@@ -22,7 +22,6 @@
NSString.cpp
LINK_LIBS
- clangAST
lldbCore
lldbDataFormatters
lldbExpression
@@ -32,6 +31,8 @@
lldbUtility
lldbPluginAppleObjCRuntime
lldbPluginClangCommon
+ CLANG_LIBS
+ clangAST
EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS}
)
Index: lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -27,6 +27,16 @@
${tablegen_deps}
LINK_LIBS
+ lldbCore
+ lldbExpression
+ lldbHost
+ lldbInterpreter
+ lldbSymbol
+ lldbTarget
+ lldbUtility
+ lldbPluginCPlusPlusLanguage
+ lldbPluginCPPRuntime
+ CLANG_LIBS
clangAST
clangCodeGen
clangDriver
@@ -38,15 +48,6 @@
clangRewriteFrontend
clangSema
clangSerialization
- lldbCore
- lldbExpression
- lldbHost
- lldbInterpreter
- lldbSymbol
- lldbTarget
- lldbUtility
- lldbPluginCPlusPlusLanguage
- lldbPluginCPPRuntime
LINK_COMPONENTS
Core
ExecutionEngine
Index: lldb/source/Core/CMakeLists.txt
===================================================================
--- lldb/source/Core/CMakeLists.txt
+++ lldb/source/Core/CMakeLists.txt
@@ -69,7 +69,6 @@
clang-tablegen-targets
LINK_LIBS
- clangDriver
lldbBreakpoint
lldbDataFormatters
lldbExpression
@@ -82,6 +81,9 @@
lldbPluginObjCLanguage
${LLDB_CURSES_LIBS}
+ CLANG_LIBS
+ clangDriver
+
LINK_COMPONENTS
Support
Demangle
Index: lldb/cmake/modules/AddLLDB.cmake
===================================================================
--- lldb/cmake/modules/AddLLDB.cmake
+++ lldb/cmake/modules/AddLLDB.cmake
@@ -37,7 +37,7 @@
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 @@
${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 @@
cmake_parse_arguments(ARG
"GENERATE_INSTALL"
"INSTALL_PREFIX;ENTITLEMENTS"
- "LINK_LIBS;LINK_COMPONENTS"
+ "LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS"
${ARGN}
)
@@ -156,6 +162,11 @@
)
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)
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits