Преглед на файлове

[macOS] perform ad-hoc codesigning

Andrey Filipenkov преди 3 години
родител
ревизия
5637cdbe3f
променени са 2 файла, в които са добавени 24 реда и са изтрити 0 реда
  1. 14 0
      osx/CMakeLists.txt
  2. 10 0
      osx/entitlements.plist

+ 14 - 0
osx/CMakeLists.txt

@@ -44,6 +44,20 @@ if(APPLE)
 		)
 		file(REMOVE \"${bundleContentsDir}/conan_imports_manifest.txt\")
 	")
+
+	# perform ad-hoc codesigning
+	set(codesignCommand "codesign --verbose=4 --force --options=runtime --timestamp=none --sign -")
+	set(codesignCommandWithEntitlements "${codesignCommand} --entitlements \"${CMAKE_SOURCE_DIR}/osx/entitlements.plist\"")
+	install(CODE "
+		execute_process(COMMAND
+			${codesignCommand} \"${bundleContentsDir}/MacOS/vcmibuilder\"
+		)
+		foreach(executable vcmiclient vcmiserver vcmilauncher)
+			execute_process(COMMAND
+				${codesignCommandWithEntitlements} \"${bundleContentsDir}/MacOS/\${executable}\"
+			)
+		endforeach()
+	")
 endif(APPLE)
 
 # This will likely only work for Vcpkg

+ 10 - 0
osx/entitlements.plist

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.security.cs.disable-library-validation</key>
+	<true/>
+	<key>com.apple.security.get-task-allow</key>
+	<true/>
+</dict>
+</plist>