Skip to content

Commit 393982e

Browse files
committed
Specify the dependencies of lldb-server manually
Summary: This basically just inlines the LLDBDependencies.cmake file into lldb-server CMakeLists.txt. The reason is that most of these dependencies are not actually necessary for lldb-server (some of them can't be removed because of cross-dependencies, but most of the plugins can). I intend to start cleaning these up in follow-up commits, but I want to do this first, so the subsequent ones can be easily reverted if they don't build in some configurations. When I cleaned these up locally, I was able to get a 30%--50% improvement in lldb-server size. Reviewers: zturner, beanz, tfiala Subscribers: danalbert, srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D26975 llvm-svn: 288159
1 parent 9d03c03 commit 393982e

File tree

1 file changed

+209
-1
lines changed

1 file changed

+209
-1
lines changed

lldb/tools/lldb-server/CMakeLists.txt

Lines changed: 209 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,215 @@ endif ()
2323

2424
include_directories(../../source)
2525

26-
include(../../cmake/LLDBDependencies.cmake)
26+
27+
set( LLDB_USED_LIBS
28+
lldbBase
29+
lldbBreakpoint
30+
lldbCommands
31+
lldbDataFormatters
32+
lldbHost
33+
lldbCore
34+
lldbExpression
35+
lldbInitialization
36+
lldbInterpreter
37+
lldbSymbol
38+
lldbTarget
39+
lldbUtility
40+
41+
# Plugins
42+
lldbPluginDisassemblerLLVM
43+
lldbPluginSymbolFileDWARF
44+
lldbPluginSymbolFilePDB
45+
lldbPluginSymbolFileSymtab
46+
lldbPluginDynamicLoaderStatic
47+
lldbPluginDynamicLoaderPosixDYLD
48+
lldbPluginDynamicLoaderHexagonDYLD
49+
lldbPluginDynamicLoaderWindowsDYLD
50+
51+
lldbPluginCPlusPlusLanguage
52+
lldbPluginGoLanguage
53+
lldbPluginJavaLanguage
54+
lldbPluginObjCLanguage
55+
lldbPluginObjCPlusPlusLanguage
56+
lldbPluginOCamlLanguage
57+
58+
lldbPluginObjectFileELF
59+
lldbPluginObjectFileJIT
60+
lldbPluginSymbolVendorELF
61+
lldbPluginObjectContainerBSDArchive
62+
lldbPluginObjectContainerMachOArchive
63+
lldbPluginProcessGDBRemote
64+
lldbPluginProcessUtility
65+
lldbPluginPlatformAndroid
66+
lldbPluginPlatformGDB
67+
lldbPluginPlatformFreeBSD
68+
lldbPluginPlatformKalimba
69+
lldbPluginPlatformLinux
70+
lldbPluginPlatformNetBSD
71+
lldbPluginPlatformPOSIX
72+
lldbPluginPlatformWindows
73+
lldbPluginObjectContainerMachOArchive
74+
lldbPluginObjectContainerBSDArchive
75+
lldbPluginPlatformMacOSX
76+
lldbPluginStructuredDataDarwinLog
77+
lldbPluginDynamicLoaderMacOSXDYLD
78+
lldbPluginUnwindAssemblyInstEmulation
79+
lldbPluginUnwindAssemblyX86
80+
lldbPluginAppleObjCRuntime
81+
lldbPluginRenderScriptRuntime
82+
lldbPluginLanguageRuntimeGo
83+
lldbPluginLanguageRuntimeJava
84+
lldbPluginCXXItaniumABI
85+
lldbPluginABIMacOSX_arm
86+
lldbPluginABIMacOSX_arm64
87+
lldbPluginABIMacOSX_i386
88+
lldbPluginABISysV_arm
89+
lldbPluginABISysV_arm64
90+
lldbPluginABISysV_i386
91+
lldbPluginABISysV_x86_64
92+
lldbPluginABISysV_hexagon
93+
lldbPluginABISysV_ppc
94+
lldbPluginABISysV_ppc64
95+
lldbPluginABISysV_mips
96+
lldbPluginABISysV_mips64
97+
lldbPluginABISysV_s390x
98+
lldbPluginInstructionARM
99+
lldbPluginInstructionARM64
100+
lldbPluginInstructionMIPS
101+
lldbPluginInstructionMIPS64
102+
lldbPluginObjectFilePECOFF
103+
lldbPluginOSGo
104+
lldbPluginOSPython
105+
lldbPluginMemoryHistoryASan
106+
lldbPluginInstrumentationRuntimeAddressSanitizer
107+
lldbPluginInstrumentationRuntimeThreadSanitizer
108+
lldbPluginSystemRuntimeMacOSX
109+
lldbPluginProcessElfCore
110+
lldbPluginProcessMinidump
111+
lldbPluginJITLoaderGDB
112+
lldbPluginExpressionParserClang
113+
lldbPluginExpressionParserGo
114+
)
115+
116+
# Windows-only libraries
117+
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
118+
list(APPEND LLDB_USED_LIBS
119+
lldbPluginProcessWindows
120+
lldbPluginProcessWindowsCommon
121+
Ws2_32
122+
Rpcrt4
123+
)
124+
endif ()
125+
126+
# Linux-only libraries
127+
if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
128+
list(APPEND LLDB_USED_LIBS
129+
lldbPluginProcessLinux
130+
lldbPluginProcessPOSIX
131+
)
132+
endif ()
133+
134+
# FreeBSD-only libraries
135+
if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
136+
list(APPEND LLDB_USED_LIBS
137+
lldbPluginProcessFreeBSD
138+
lldbPluginProcessPOSIX
139+
)
140+
endif ()
141+
142+
# NetBSD-only libraries
143+
if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
144+
list(APPEND LLDB_USED_LIBS
145+
lldbPluginProcessPOSIX
146+
)
147+
endif ()
148+
149+
# Darwin-only libraries
150+
if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
151+
list(APPEND LLDB_USED_LIBS
152+
lldbPluginDynamicLoaderDarwinKernel
153+
lldbPluginObjectFileMachO
154+
lldbPluginProcessMachCore
155+
lldbPluginProcessMacOSXKernel
156+
lldbPluginSymbolVendorMacOSX
157+
)
158+
endif()
159+
160+
set( CLANG_USED_LIBS
161+
clangAnalysis
162+
clangAST
163+
clangBasic
164+
clangCodeGen
165+
clangDriver
166+
clangEdit
167+
clangFrontend
168+
clangLex
169+
clangParse
170+
clangRewrite
171+
clangRewriteFrontend
172+
clangSema
173+
clangSerialization
174+
)
175+
176+
set(LLDB_SYSTEM_LIBS)
177+
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT __ANDROID_NDK__)
178+
if (NOT LLDB_DISABLE_LIBEDIT)
179+
list(APPEND LLDB_SYSTEM_LIBS edit)
180+
endif()
181+
if (NOT LLDB_DISABLE_CURSES)
182+
list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
183+
if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
184+
list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
185+
endif()
186+
endif()
187+
endif()
188+
189+
if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
190+
list(APPEND LLDB_SYSTEM_LIBS atomic)
191+
endif()
192+
193+
# On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc.
194+
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
195+
list(APPEND LLDB_SYSTEM_LIBS execinfo)
196+
endif()
197+
198+
if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC)
199+
list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES})
200+
endif()
201+
202+
list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
203+
204+
if (LLVM_BUILD_STATIC)
205+
if (NOT LLDB_DISABLE_PYTHON)
206+
list(APPEND LLDB_SYSTEM_LIBS python2.7 util)
207+
endif()
208+
if (NOT LLDB_DISABLE_CURSES)
209+
list(APPEND LLDB_SYSTEM_LIBS gpm)
210+
endif()
211+
endif()
212+
213+
set(LLVM_LINK_COMPONENTS
214+
${LLVM_TARGETS_TO_BUILD}
215+
interpreter
216+
asmparser
217+
bitreader
218+
bitwriter
219+
codegen
220+
demangle
221+
ipo
222+
selectiondag
223+
bitreader
224+
mc
225+
mcjit
226+
core
227+
mcdisassembler
228+
executionengine
229+
runtimedyld
230+
option
231+
support
232+
coverage
233+
target
234+
)
27235

28236
add_lldb_executable(lldb-server INCLUDE_IN_FRAMEWORK
29237
Acceptor.cpp

0 commit comments

Comments
 (0)