From 37b18f7a67b5dc503d7cdee36af1edf1728db123 Mon Sep 17 00:00:00 2001 From: Erik Smistad Date: Thu, 1 Feb 2024 12:28:54 +0100 Subject: [PATCH] Update FixRPaths.cmake [no ci] --- cmake/FixRPaths.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/FixRPaths.cmake b/cmake/FixRPaths.cmake index 803cc0a6d..fd0172e08 100644 --- a/cmake/FixRPaths.cmake +++ b/cmake/FixRPaths.cmake @@ -5,9 +5,16 @@ if(APPLE) foreach(SO ${installedSOs}) if(NOT IS_SYMLINK ${SO}) message("-- Setting runtime path of ${SO}") - execute_process(COMMAND codesign --remove-signature ${SO}) # adding rpath makes any signed binaries invalid which will make macos complain + if(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") - execute_process(COMMAND codesign -s - --entitlements ${SO}) + message("-- Trying some arm64 codesign stuff for ${SO}") + execute_process(COMMAND codesign -v ${SO} OUTPUT_VARIABLE RESULT) + if(${RESULT} STREQUAL "") + message("-- Removing signature for ${SO}") + execute_process(COMMAND codesign --remove-signature ${SO}) # adding rpath makes any signed binaries invalid which will make macos complain + endif() + else() + execute_process(COMMAND codesign --remove-signature ${SO}) # adding rpath makes any signed binaries invalid which will make macos complain endif() execute_process(COMMAND install_name_tool -add_rpath "@loader_path/../lib" ${SO}) endif()