-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to install relocable shared lib on macOS (install_name set to @rpath
)?
#10099
Comments
The use of So the problem it is trying to fix is basically "everything is broken and horrible by default, except when you build a relocatable package which is not the default and requires more work than just using It was mentioned in the PR that it would be good to have a configure time option to choose which one you want, but that such an option wasn't a blocker for the PR because "it's already broken but this makes it work for at least some cases". A pretty strong stance, hmm. :) And here we are 3.5 years later and no one has added (or even requested?) that option. |
Ok, I'm not asking to change default behavior, just to provide some option to set install_name to I've looked a little bit to this PR, and several comments in commits are quite surprising:
CMake handles external lib path injection into RPATH of executables of the build tree out of the box.
It's not the most flexible approach nowadays.
Default behavior of CMake >= 3.0 is not the same than Autotools nor Meson (https://cmake.org/cmake/help/v3.0/policy/CMP0042.html and rational behind CMake logic: https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling#default-rpath-settings). |
I'm trying to fix meson based recipes in conan-center (https://github.com/conan-io/conan-center-index) regarding install_name in shared libs on macOS.
conan-center is supposed to provide fully relocatable packages, therefore absolute path in install_name is not an option. install_name must be
@rpath
. How to you achieve this behavior with Meson (except running otool manually which is something I want to avoid because it's tedious to automate)?I'm also wondering why it's the default behavior in Meson? CMake default behavior is to set install_name to
@rpath
and cleanup RPATH in installed binaries, and I think it's a good default.The text was updated successfully, but these errors were encountered: