Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Set DYLIB_INSTALL_NAME_BASE to @rpath #104

Merged
merged 2 commits into from Dec 7, 2016

Conversation

tonyarnold
Copy link
Contributor

I ran into some trouble using MASShortcut alongside @IBDesignable in Xcode tonight, and noticed that the INSTALL_PATH had been hard-coded to "@executable_path/../Frameworks" and the DYLIB_INSTALL_NAME_BASE was defaulting to /Library/Frameworks.

Since Mac OS X 10.5, setting DYLIB_INSTALL_NAME_PATH to @rpath has been the preferred setting - this allows apps and other frameworks to ask the dynamic linker to search a specific list of locations (set using the LD_RUNPATH_SEARCH_PATHS variable), rather than hard coding the list of places into the library.

There's more info at https://www.mikeash.com/pyblog/friday-qa-2009-11-06-linking-and-install-names.html, but it resolved the Interface Builder issues I was having, and these settings are the defaults when you create a new macOS framework project in Xcode 8 so they should be reasonably safe to include.

@shpakovski
Copy link
Collaborator

What a fantastic catch, thanks a lot Tony!

@shpakovski shpakovski merged commit 7b265ca into cocoabits:master Dec 7, 2016
@tonyarnold tonyarnold deleted the fix/install-name-base branch January 28, 2017 03:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants