desktop (mac): removing rpaths (#3136)

* desktop (mac): removing rpaths

* one more lib

* added check for dir existence in linking

* new line

* patching libapp on mac
This commit is contained in:
Stanislav Dmitrenko
2023-09-27 22:34:46 +08:00
committed by GitHub
parent 3c7fc6b0ee
commit 7e17ed7b1b
3 changed files with 52 additions and 9 deletions

View File

@@ -73,6 +73,11 @@ else()
target_link_libraries(app-lib rts simplex)
endif()
if(APPLE)
add_custom_command(TARGET app-lib POST_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/patch-libapp-mac.sh
)
endif()
# Trying to copy resulting files into needed directory, but none of these work for some reason. This could allow to

View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -e
lib=libapp-lib.dylib
RPATHS=$(otool -l $lib | grep -E '/Users|/opt/|/usr/local' | cut -d' ' -f11)
for RPATH in $RPATHS; do
install_name_tool -delete_rpath $RPATH $lib
done