From 5637cdbe3f755da5b9279e5fef5a448d2f7d3698 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 13 Sep 2022 15:27:44 +0300 Subject: [PATCH] [macOS] perform ad-hoc codesigning --- osx/CMakeLists.txt | 14 ++++++++++++++ osx/entitlements.plist | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 osx/entitlements.plist diff --git a/osx/CMakeLists.txt b/osx/CMakeLists.txt index 990a0ee15..9c0057da9 100644 --- a/osx/CMakeLists.txt +++ b/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 diff --git a/osx/entitlements.plist b/osx/entitlements.plist new file mode 100644 index 000000000..c532e2d06 --- /dev/null +++ b/osx/entitlements.plist @@ -0,0 +1,10 @@ + + + + + com.apple.security.cs.disable-library-validation + + com.apple.security.get-task-allow + + +