2014-11-08 09:41:49 +08:00
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
|
|
|
|
include_directories(
|
2015-05-10 23:22:09 +08:00
|
|
|
../../../../llvm/include
|
2014-11-08 09:41:49 +08:00
|
|
|
../../source/Plugins/Process/Linux
|
|
|
|
../../source/Plugins/Process/POSIX
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
|
|
|
|
include_directories(
|
2015-05-10 23:22:09 +08:00
|
|
|
../../../../llvm/include
|
2014-11-08 09:41:49 +08:00
|
|
|
../../source/Plugins/Process/FreeBSD
|
|
|
|
../../source/Plugins/Process/POSIX
|
|
|
|
)
|
|
|
|
endif ()
|
2015-02-18 23:39:41 +08:00
|
|
|
|
2015-10-24 08:27:04 +08:00
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
|
|
|
|
include_directories(
|
|
|
|
../../../../llvm/include
|
|
|
|
../../source/Plugins/Process/POSIX
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2013-11-22 02:39:32 +08:00
|
|
|
include_directories(../../source)
|
|
|
|
|
2017-02-01 05:12:52 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2016-11-30 00:40:57 +08:00
|
|
|
set(LLDB_SYSTEM_LIBS)
|
2016-12-05 19:15:36 +08:00
|
|
|
if (NOT LLDB_DISABLE_LIBEDIT)
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS edit)
|
|
|
|
endif()
|
|
|
|
if (NOT LLDB_DISABLE_CURSES)
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
|
|
|
|
if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
|
2016-11-30 00:40:57 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS atomic)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc.
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS execinfo)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC)
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
|
|
|
|
|
|
|
|
if (LLVM_BUILD_STATIC)
|
|
|
|
if (NOT LLDB_DISABLE_PYTHON)
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS python2.7 util)
|
|
|
|
endif()
|
|
|
|
if (NOT LLDB_DISABLE_CURSES)
|
|
|
|
list(APPEND LLDB_SYSTEM_LIBS gpm)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-02-01 05:12:52 +08:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2016-12-16 06:01:17 +08:00
|
|
|
add_lldb_tool(lldb-server INCLUDE_IN_FRAMEWORK
|
2015-10-22 03:34:26 +08:00
|
|
|
Acceptor.cpp
|
2015-01-15 05:01:15 +08:00
|
|
|
lldb-gdbserver.cpp
|
2015-02-18 23:39:41 +08:00
|
|
|
lldb-platform.cpp
|
2015-05-27 21:34:04 +08:00
|
|
|
lldb-server.cpp
|
|
|
|
LLDBServerUtilities.cpp
|
2017-02-01 04:43:05 +08:00
|
|
|
)
|
2016-01-29 19:59:57 +08:00
|
|
|
|
2017-02-01 05:12:52 +08:00
|
|
|
# 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()
|
|
|
|
|
2016-01-29 19:59:57 +08:00
|
|
|
target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})
|