diff options
-rw-r--r-- | lldb/CMakeLists.txt | 16 | ||||
-rw-r--r-- | lldb/test/CMakeLists.txt | 11 | ||||
-rw-r--r-- | lldb/tools/debugserver/source/CMakeLists.txt | 10 | ||||
-rw-r--r-- | lldb/unittests/tools/lldb-server/CMakeLists.txt | 2 |
4 files changed, 26 insertions, 13 deletions
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 2558033b32a..72cdd55c357 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -56,6 +56,22 @@ if (NOT LLDB_DISABLE_PYTHON) add_subdirectory(scripts) endif () + +if(CMAKE_HOST_APPLE) + if(LLDB_CODESIGN_IDENTITY) + set(DEBUGSERVER_PATH $<TARGET_FILE:debugserver>) + else() + execute_process( + COMMAND xcode-select -p + OUTPUT_VARIABLE XCODE_DEV_DIR) + string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR) + set(DEBUGSERVER_PATH + "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver") + set(SKIP_DEBUGSERVER True) + endif() + message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}") +endif() + add_subdirectory(source) add_subdirectory(tools) diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index 612dc4fd9c1..ff0fe1534e1 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -110,17 +110,6 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") endif() if(CMAKE_HOST_APPLE) - if(LLDB_CODESIGN_IDENTITY) - set(DEBUGSERVER_PATH $<TARGET_FILE:debugserver>) - else() - execute_process( - COMMAND xcode-select -p - OUTPUT_VARIABLE XCODE_DEV_DIR) - string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR) - set(DEBUGSERVER_PATH - "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver") - endif() - message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}") list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH}) endif() diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt index d99880cd97f..e70e90923a3 100644 --- a/lldb/tools/debugserver/source/CMakeLists.txt +++ b/lldb/tools/debugserver/source/CMakeLists.txt @@ -195,7 +195,15 @@ if("${LLDB_CODESIGN_IDENTITY}" STREQUAL "lldb_codesign") endif() option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults Off when using lldb_codesign identity, otherwise On)" ${LLDB_USE_ENTITLEMENTS_Default}) -if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")) +if ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "") + if (CMAKE_HOST_APPLE) + # If we haven't built a signed debugserver, copy the one from the system. + add_custom_target(debugserver + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEBUGSERVER_PATH} ${CMAKE_BINARY_DIR}/bin + VERBATIM + COMMENT "Copying the system debugserver to LLDB's binaries directory.") + endif() +else() if(LLDB_USE_ENTITLEMENTS) set(entitlements_flags --entitlements ${entitlements_xml}) endif() diff --git a/lldb/unittests/tools/lldb-server/CMakeLists.txt b/lldb/unittests/tools/lldb-server/CMakeLists.txt index 14df6e64b2a..dcbd9bed529 100644 --- a/lldb/unittests/tools/lldb-server/CMakeLists.txt +++ b/lldb/unittests/tools/lldb-server/CMakeLists.txt @@ -13,7 +13,7 @@ add_lldb_test_executable(thread_inferior inferior/thread_inferior.cpp) add_lldb_test_executable(environment_check inferior/environment_check.cpp) if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - add_definitions(-DLLDB_SERVER="$<TARGET_FILE:debugserver>" -DLLDB_SERVER_IS_DEBUGSERVER=1) + add_definitions(-DLLDB_SERVER="${DEBUGSERVER_PATH}" -DLLDB_SERVER_IS_DEBUGSERVER=1) else() add_definitions(-DLLDB_SERVER="$<TARGET_FILE:lldb-server>" -DLLDB_SERVER_IS_DEBUGSERVER=0) endif() |