[PATCH] D55816: [CMake] Use XCODE_ATTRIBUTE properties for code signing and entitlements in Xcode

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 01:26:26 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL350383: [CMake] Use XCODE_ATTRIBUTE properties for code signing and entitlements in… (authored by stefan.graenitz, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55816/new/

https://reviews.llvm.org/D55816

Files:
  llvm/trunk/cmake/modules/AddLLVM.cmake


Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1620,7 +1620,16 @@
     return()
   endif()
 
-  if(APPLE)
+  if(CMAKE_GENERATOR STREQUAL "Xcode")
+    set_target_properties(${name} PROPERTIES
+      XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${LLVM_CODESIGNING_IDENTITY}
+    )
+    if(DEFINED ARG_ENTITLEMENTS)
+      set_target_properties(${name} PROPERTIES
+        XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ARG_ENTITLEMENTS}
+      )
+    endif()
+  elseif(APPLE)
     if(NOT CMAKE_CODESIGN)
       set(CMAKE_CODESIGN xcrun codesign)
     endif()
@@ -1634,18 +1643,13 @@
     if(DEFINED ARG_ENTITLEMENTS)
       set(pass_entitlements --entitlements ${ARG_ENTITLEMENTS})
     endif()
-    if(CMAKE_GENERATOR STREQUAL "Xcode")
-      # Avoid double-signing error: Since output overwrites input, Xcode runs
-      # the post-build rule even if the actual build-step was skipped.
-      set(pass_force --force)
-    endif()
 
     add_custom_command(
       TARGET ${name} POST_BUILD
       COMMAND ${CMAKE_COMMAND} -E
               env CODESIGN_ALLOCATE=${CMAKE_CODESIGN_ALLOCATE}
               ${CMAKE_CODESIGN} -s ${LLVM_CODESIGNING_IDENTITY}
-              ${pass_entitlements} ${pass_force} $<TARGET_FILE:${name}>
+              ${pass_entitlements} $<TARGET_FILE:${name}>
     )
   endif()
 endfunction()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55816.180206.patch
Type: text/x-patch
Size: 1461 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190104/d57972eb/attachment.bin>


More information about the llvm-commits mailing list