From 4605b49cfcc7e26b221700f305c9ab68ad87c77d Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 29 Aug 2022 15:54:46 -0300 Subject: [PATCH] Fix codesigning: reenable extension provisioning profile The macOS PR that was merged accidentally dropped a cmake option that result in the extension's provisioning profile not getting copied into place (but was working locally because I was using a build dir where the variable was still set). This restores the option to fix the codesigning. --- cmake/macos.cmake | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cmake/macos.cmake b/cmake/macos.cmake index afc984964..9ecffb4a7 100644 --- a/cmake/macos.cmake +++ b/cmake/macos.cmake @@ -14,6 +14,8 @@ if(MACOS_SYSTEM_EXTENSION) endif() set(CODESIGN_PROFILE "${PROJECT_SOURCE_DIR}/contrib/macos/lokinet.${default_profile_type}.provisionprofile" CACHE FILEPATH "Path to a .provisionprofile to use for the main app") +set(CODESIGN_EXT_PROFILE "${PROJECT_SOURCE_DIR}/contrib/macos/lokinet-extension.${default_profile_type}.provisionprofile" CACHE FILEPATH + "Path to a .provisionprofile to use for the lokinet extension") if(CODESIGN AND NOT CODESIGN_ID) if(MACOS_SYSTEM_EXTENSION) @@ -59,13 +61,15 @@ else() endif() -if(NOT CODESIGN_PROFILE) - message(WARNING "Missing a CODESIGN_PROFILE provisioning profile: Apple will most likely log an uninformative error message to the system log and then kill harmless kittens if you try to run the result") -endif() -if(NOT EXISTS "${CODESIGN_PROFILE}") - message(FATAL_ERROR "Provisioning profile ${CODESIGN_PROFILE} does not exist; fix your -DCODESIGN_PROFILE path") -endif() -message(STATUS "Using ${CODESIGN_PROFILE} provisioning profile") +foreach(prof IN ITEMS CODESIGN_PROFILE CODESIGN_EXT_PROFILE) + if(NOT ${prof}) + message(WARNING "Missing a ${prof} provisioning profile: Apple will most likely log an uninformative error message to the system log and then kill harmless kittens if you try to run the result") + elseif(NOT EXISTS "${${prof}}") + message(FATAL_ERROR "Provisioning profile ${${prof}} does not exist; fix your -D${prof} path") + endif() +endforeach() +message(STATUS "Using ${CODESIGN_PROFILE} app provisioning profile") +message(STATUS "Using ${CODESIGN_EXT_PROFILE} extension provisioning profile")