llvm-project/lldb/tools/driver/CMakeLists.txt
Chris Bieneman 494f277af5 [CMake] Add accurate dependency specifications
Summary:
This patch adds accurate dependency specifications to the mail LLDB libraries and tools.

In all cases except lldb-server, these dependencies are added in addition to existing dependencies (making this low risk), and I performed some code cleanup along the way.

For lldb-server I've cleaned up the LLVM dependencies down to just the minimum actually required. This is more than lldb-server actually directly references, and I've left a todo in the code to clean that up.

Reviewers: labath, zturner

Subscribers: lldb-commits, danalbert, srhines, ki.stfu, mgorny, jgosnell

Differential Revision: https://reviews.llvm.org/D29333

llvm-svn: 293686
2017-01-31 20:43:05 +00:00

41 lines
1.0 KiB
CMake

include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
if ((CMAKE_SYSTEM_NAME MATCHES "Windows") OR
(CMAKE_SYSTEM_NAME MATCHES "NetBSD" ))
# These targets do not have getopt support, so they rely on the one provided by
# liblldb. However, getopt is not a part of the liblldb interface, so we have
# to link against the constituent libraries manually. Note that this is
# extremely scary as it introduces ODR violations, and it should go away as
# soon as possible.
set(host_lib lldbHost)
endif()
add_lldb_tool(lldb
Driver.cpp
Platform.cpp
LINK_LIBS
liblldb
${host_lib}
LINK_COMPONENTS
Support
)
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
add_definitions( -DIMPORT_LIBLLDB )
endif()
# Add lldb dependency on lldb-server if we can use it.
if ( LLDB_CAN_USE_LLDB_SERVER )
add_dependencies(lldb lldb-server)
endif()
# Add lldb dependency on debugserver if we can use it.
if ( LLDB_CAN_USE_DEBUGSERVER )
add_dependencies(lldb debugserver)
endif()
set_target_properties(lldb PROPERTIES VERSION ${LLDB_VERSION})