summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Hinton <hintonda@gmail.com>2018-02-17 19:17:21 +0000
committerDon Hinton <hintonda@gmail.com>2018-02-17 19:17:21 +0000
commitd8a6b90e83944a7c472cbfeb912f2ced1ae7f5c2 (patch)
treea0adff8ce4f4988c339850cd03cbbbf59e7c2741
parent2cd14e16a6b199c8a10d536470bc61b723543160 (diff)
downloadbcm5719-llvm-d8a6b90e83944a7c472cbfeb912f2ced1ae7f5c2.tar.gz
bcm5719-llvm-d8a6b90e83944a7c472cbfeb912f2ced1ae7f5c2.zip
[cmake] Fix LLDB_CODESIGN_IDENTITY logic.
Summary: Consolidate LLDB_CODESIGN_IDENTITY logic in one place and use SKIP_DEBUGSERVER, which can be set independently, to control codesigning targets. Currently, running cmake the first time in a clean directory, without passing -DLLDB_CODESIGN_IDENTITY='', fails. However, subsequent runs succeed. That's because LLDB_CODESIGN_IDENTITY gets added to the CACHE after the initial test. To fix that, the default value must be set before it's tested. Here's the error produced on the first run: CMake Error at tools/lldb/tools/debugserver/source/CMakeLists.txt:215 (add_custom_command): No TARGET 'debugserver' has been created in this directory. Differential Revision: https://reviews.llvm.org/D43432 llvm-svn: 325442
-rw-r--r--lldb/CMakeLists.txt15
-rw-r--r--lldb/tools/debugserver/source/CMakeLists.txt20
2 files changed, 17 insertions, 18 deletions
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 72cdd55c357..bc04e9b4ae4 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -57,21 +57,6 @@ 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/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt
index e70e90923a3..377a78ab794 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -95,6 +95,22 @@ set(lldbDebugserverCommonSources
add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
+set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
+ CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
+
+if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "")
+ 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}")
+
if (APPLE)
if(IOS)
find_library(BACKBOARD_LIBRARY BackBoardServices
@@ -187,15 +203,13 @@ if(IOS)
set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/debugserver-entitlements.plist)
endif()
-set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
- CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
set(LLDB_USE_ENTITLEMENTS_Default On)
if("${LLDB_CODESIGN_IDENTITY}" STREQUAL "lldb_codesign")
set(LLDB_USE_ENTITLEMENTS_Default Off)
endif()
option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults Off when using lldb_codesign identity, otherwise On)" ${LLDB_USE_ENTITLEMENTS_Default})
-if ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")
+if (SKIP_DEBUGSERVER)
if (CMAKE_HOST_APPLE)
# If we haven't built a signed debugserver, copy the one from the system.
add_custom_target(debugserver
OpenPOWER on IntegriCloud