endif()
if(${targetkind} MATCHES "SHARED")
- set(LINK_KEYWORD PUBLIC)
+ set(LINK_KEYWORD PRIVATE)
endif()
if(${targetkind} MATCHES "SHARED" OR ${targetkind} MATCHES "EXE")
if (PARAM_OBJECT)
add_library(${name} ${libkind} ${srcs})
else()
- llvm_add_library(${name} ${libkind} DISABLE_LLVM_LINK_LLVM_DYLIB ${srcs})
-
- lldb_link_common_libs(${name} "${libkind}")
-
if (PARAM_SHARED)
if (LLDB_LINKER_SUPPORTS_GROUPS)
- target_link_libraries(${name} PUBLIC
- -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
+ llvm_add_library(${name} ${libkind} ${srcs} LINK_LIBS
+ -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group
+ -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group
+ )
else()
- target_link_libraries(${name} PUBLIC ${CLANG_USED_LIBS})
+ llvm_add_library(${name} ${libkind} ${srcs} LINK_LIBS
+ ${LLDB_USED_LIBS} ${CLANG_USED_LIBS}
+ )
endif()
+ else()
+ llvm_add_library(${name} ${libking} ${srcs})
endif()
- llvm_config(${name} ${LLVM_LINK_COMPONENTS} ${LLVM_PRIVATE_LINK_COMPONENTS})
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "liblldb")
if (PARAM_SHARED)
macro(add_lldb_executable name)
cmake_parse_arguments(ARG "INCLUDE_IN_FRAMEWORK" "" "" ${ARGN})
- add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARG_UNPARSED_ARGUMENTS})
+ add_llvm_executable(${name} ${ARG_UNPARSED_ARGUMENTS})
set_target_properties(${name} PROPERTIES
FOLDER "lldb executables")
+include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
+
add_lldb_executable(lldb-argdumper INCLUDE_IN_FRAMEWORK
argdumper.cpp
)
-target_link_libraries(lldb-argdumper liblldb)
+if (LLDB_LINKER_SUPPORTS_GROUPS)
+ target_link_libraries(lldb-argdumper -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
+else()
+ target_link_libraries(lldb-argdumper ${LLDB_USED_LIBS})
+endif()
+llvm_config(lldb-argdumper ${LLVM_LINK_COMPONENTS})
+
install(TARGETS lldb-argdumper
RUNTIME DESTINATION bin)
+include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
+
add_lldb_executable(lldb
Driver.cpp
Platform.cpp
endif()
target_link_libraries(lldb liblldb)
-# TODO: why isn't this done by add_lldb_executable?
-#target_link_libraries(lldb ${LLDB_USED_LIBS})
-#llvm_config(lldb ${LLVM_LINK_COMPONENTS})
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+ # Windows does not have getopt support, so it relies on the one provided by
+ # liblldb. However, getopt is not a part of the liblldb interfact, 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.
+ target_link_libraries(lldb ${LLDB_USED_LIBS})
+endif()
set_target_properties(lldb PROPERTIES VERSION ${LLDB_VERSION})