[Lldb-commits] [PATCH] D54444: [CMake] Use extended llvm_codesign to pass entitlements for lldb-server

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 13 07:11:33 PST 2018


sgraenitz updated this revision to Diff 173849.
sgraenitz added a comment.

unset not necessary, fix comment, globally set LLVM_CODESIGNING_IDENTITY from LLDB_CODESIGN_IDENTITY


https://reviews.llvm.org/D54444

Files:
  CMakeLists.txt
  cmake/modules/AddLLDB.cmake
  tools/lldb-server/CMakeLists.txt


Index: tools/lldb-server/CMakeLists.txt
===================================================================
--- tools/lldb-server/CMakeLists.txt
+++ tools/lldb-server/CMakeLists.txt
@@ -42,6 +42,11 @@
   list(APPEND LLDB_PLUGINS lldbPluginObjectFileELF)
 endif()
 
+if(LLDB_USE_ENTITLEMENTS AND NOT IOS)
+  # Same entitlements file as used for debugserver
+  set(entitlements ${LLDB_SOURCE_DIR}/resources/debugserver-macosx-entitlements.plist)
+endif()
+
 add_lldb_tool(lldb-server INCLUDE_IN_SUITE
     Acceptor.cpp
     lldb-gdbserver.cpp
@@ -61,6 +66,9 @@
 
     LINK_COMPONENTS
       Support
+
+    ENTITLEMENTS
+      ${entitlements}
 )
 
 target_link_libraries(lldb-server PRIVATE ${LLDB_SYSTEM_LIBS})
Index: cmake/modules/AddLLDB.cmake
===================================================================
--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -100,13 +100,13 @@
 function(add_lldb_executable name)
   cmake_parse_arguments(ARG
     "INCLUDE_IN_SUITE;GENERATE_INSTALL"
-    ""
+    "ENTITLEMENTS"
     "LINK_LIBS;LINK_COMPONENTS"
     ${ARGN}
     )
 
   list(APPEND LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
-  add_llvm_executable(${name} ${ARG_UNPARSED_ARGUMENTS})
+  add_llvm_executable(${name} ${ARG_UNPARSED_ARGUMENTS} ENTITLEMENTS ${ARG_ENTITLEMENTS})
 
   target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS})
   set_target_properties(${name} PROPERTIES
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -11,6 +11,12 @@
 include(LLDBConfig)
 include(AddLLDB)
 
+option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON)
+if(LLDB_CODESIGN_IDENTITY)
+  # In the future we may use LLVM_CODESIGNING_IDENTITY directly.
+  set(LLVM_CODESIGNING_IDENTITY ${LLDB_CODESIGN_IDENTITY})
+endif()
+
 # Define the LLDB_CONFIGURATION_xxx matching the build type
 if( uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
   add_definitions( -DLLDB_CONFIGURATION_DEBUG )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54444.173849.patch
Type: text/x-patch
Size: 1999 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181113/dd1f85e9/attachment.bin>


More information about the lldb-commits mailing list