cocoabits / MASShortcut

Modern framework for managing global keyboard shortcuts compatible with Mac App Store. More details:
http://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.html
BSD 2-Clause "Simplified" License
1.52k stars 220 forks source link

Set DYLIB_INSTALL_NAME_BASE to @rpath #104

Closed tonyarnold closed 7 years ago

tonyarnold commented 7 years ago

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 commented 7 years ago

What a fantastic catch, thanks a lot Tony!