Open 7sDream opened 3 years ago
Current install name is /usr/local/lib/sciter-osx-64.dylib:
/usr/local/lib/sciter-osx-64.dylib
foo@bar:~/Cloud/SDK/sciter-sdk/bin.osx$ otool -D sciter-osx-64.dylib sciter-osx-64.dylib: /usr/local/lib/sciter-osx-64.dylib
When link with it, at runtime, executable file will try to open /usr/local/lib/sciter-osx-64.dylib only , and fails:
For now, my workaround is using install_name_tool after build to change this path in executable file to use @rpath:
install_name_tool
@rpath
# Change RPATH add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change /usr/local/lib/sciter-osx-64.dylib @rpath/sciter-osx-64.dylib $<TARGET_FILE:${PROJECT_NAME}> COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path" $<TARGET_FILE:${PROJECT_NAME}> )
The second command, add @executable_path to rpath, is a common step, and is irrelevant to this issue
@executable_path
This works for me, but after a long digging.
So how about we change the default install name to use @rpath? IIRC, it is officially recommended.
There are also many similar issue/pr in other projects, like:
etc, can be used as a reference.
Current install name is
/usr/local/lib/sciter-osx-64.dylib
:When link with it, at runtime, executable file will try to open
/usr/local/lib/sciter-osx-64.dylib
only , and fails:For now, my workaround is using
install_name_tool
after build to change this path in executable file to use@rpath
:The second command, add
@executable_path
to rpath, is a common step, and is irrelevant to this issueThis works for me, but after a long digging.
So how about we change the default install name to use
@rpath
? IIRC, it is officially recommended.There are also many similar issue/pr in other projects, like:
etc, can be used as a reference.
PS
Same situation for `sciter-js-sdk`, but to avoid duplication, I only open issue in this repo.