[Lldb-commits] [lldb] r352629 - [CMake] Accept entitlements for code signing in add_lldb_library()

Stefan Granitz via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 30 07:13:16 PST 2019


Author: stefan.graenitz
Date: Wed Jan 30 07:13:16 2019
New Revision: 352629

URL: http://llvm.org/viewvc/llvm-project?rev=352629&view=rev
Log:
[CMake] Accept entitlements for code signing in add_lldb_library()

Summary:
D57334 added entitlements support in `add_llvm_library()` so we can use it for library targets in LLDB.

Additionally this patch fixes the way that the entitlements argument is passed on from `add_lldb_executable()` to `add_llvm_executable()`. We still need the explicit parsing and passing on of single- and multi-value arguments as long as we are on CMake < 3.7 (due to bug https://gitlab.kitware.com/cmake/cmake/merge_requests/133).

Reviewers: beanz, JDevlieghere, aprantl

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

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

Modified:
    lldb/trunk/cmake/modules/AddLLDB.cmake

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=352629&r1=352628&r2=352629&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Wed Jan 30 07:13:16 2019
@@ -3,7 +3,7 @@ function(add_lldb_library name)
   # MODULE;SHARED;STATIC library type and source files
   cmake_parse_arguments(PARAM
     "MODULE;SHARED;STATIC;OBJECT;PLUGIN"
-    ""
+    "ENTITLEMENTS"
     "EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS"
     ${ARGN})
   llvm_process_sources(srcs ${PARAM_UNPARSED_ARGUMENTS})
@@ -44,6 +44,10 @@ function(add_lldb_library name)
   if (PARAM_OBJECT)
     add_library(${name} ${libkind} ${srcs})
   else()
+    if(PARAM_ENTITLEMENTS)
+      set(pass_ENTITLEMENTS ENTITLEMENTS ${PARAM_ENTITLEMENTS})
+    endif()
+
     if(LLDB_NO_INSTALL_DEFAULT_RPATH)
       set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
     endif()
@@ -51,6 +55,7 @@ function(add_lldb_library name)
     llvm_add_library(${name} ${libkind} ${srcs}
       LINK_LIBS ${PARAM_LINK_LIBS}
       DEPENDS ${PARAM_DEPENDS}
+      ${pass_ENTITLEMENTS}
       ${pass_NO_INSTALL_RPATH}
     )
 
@@ -106,14 +111,19 @@ function(add_lldb_executable name)
     ${ARGN}
     )
 
+  if(ARG_ENTITLEMENTS)
+    set(pass_ENTITLEMENTS ENTITLEMENTS ${ARG_ENTITLEMENTS})
+  endif()
+
   if(LLDB_NO_INSTALL_DEFAULT_RPATH)
     set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
   endif()
 
   list(APPEND LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
-  add_llvm_executable(${name} ${ARG_UNPARSED_ARGUMENTS}
-    ENTITLEMENTS ${ARG_ENTITLEMENTS}
+  add_llvm_executable(${name}
+    ${pass_ENTITLEMENTS}
     ${pass_NO_INSTALL_RPATH}
+    ${ARG_UNPARSED_ARGUMENTS}
   )
 
   target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS})




More information about the lldb-commits mailing list