Skip to content

Commit

Permalink
Update FixRPaths.cmake [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
smistad authored Feb 1, 2024
1 parent fafcead commit 37b18f7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmake/FixRPaths.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 37b18f7

Please sign in to comment.