Files
clang-p2996/lldb/tools/lldb-server/CMakeLists.txt
Jonas Devlieghere ccf1469a4c [lldb] Make lldbVersion a full fledged library
Because of its dependency on clang (and potentially other compilers
downstream, such as swift) lldb_private::GetVersion already lives in its
own library called lldbBase. Despite that, its implementation was spread
across unrelated files. This patch improves things by introducing a
Version library with its own directory, header and implementation file.

The benefits of this patch include:

 - We can get rid of the ugly quoting macros.
 - Other parts of LLDB can read the version number from
   lldb/Version/Version.inc.
 - The implementation can be swapped out for tools like lldb-server than
   don't need to depend on clang at all.

Differential revision: https://reviews.llvm.org/D115211
2021-12-08 15:14:34 -08:00

69 lines
1.8 KiB
CMake

set(LLVM_TARGET_DEFINITIONS LLGSOptions.td)
tablegen(LLVM LLGSOptions.inc -gen-opt-parser-defs)
add_public_tablegen_target(LLGSOptionsTableGen)
set_target_properties(LLGSOptionsTableGen PROPERTIES FOLDER "lldb misc")
set(LLDB_PLUGINS)
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
list(APPEND LLDB_PLUGINS lldbPluginProcessLinux)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
list(APPEND LLDB_PLUGINS lldbPluginProcessFreeBSD)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
list(APPEND LLDB_PLUGINS lldbPluginProcessNetBSD)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
list(APPEND LLDB_PLUGINS lldbPluginObjectFileMachO)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
list(APPEND LLDB_PLUGINS lldbPluginObjectFilePECOFF)
else()
list(APPEND LLDB_PLUGINS lldbPluginObjectFileELF)
endif()
if(APPLE_EMBEDDED)
if(LLDB_CODESIGN_IDENTITY)
# Use explicit LLDB identity
set(LLVM_CODESIGNING_IDENTITY ${LLDB_CODESIGN_IDENTITY})
else()
# Use explicit LLVM identity or default to lldb_codesign if empty
if(NOT LLVM_CODESIGNING_IDENTITY)
set(LLVM_CODESIGNING_IDENTITY lldb_codesign)
endif()
endif()
endif()
add_lldb_tool(lldb-server
Acceptor.cpp
lldb-gdbserver.cpp
lldb-platform.cpp
lldb-server.cpp
LLDBServerUtilities.cpp
SystemInitializerLLGS.cpp
LINK_LIBS
lldbHost
lldbInitialization
lldbVersion
${LLDB_PLUGINS}
lldbPluginInstructionARM
lldbPluginInstructionMIPS
lldbPluginInstructionMIPS64
${LLDB_SYSTEM_LIBS}
LINK_COMPONENTS
Option
Support
)
add_dependencies(lldb-server
LLGSOptionsTableGen
${tablegen_deps}
)
target_include_directories(lldb-server PRIVATE "${LLDB_SOURCE_DIR}/source")
target_link_libraries(lldb-server PRIVATE ${LLDB_SYSTEM_LIBS})