On Jan 6, 2006, at 10:47 AM, Greg Norz wrote: I want to link in different versions of a framework based on a project's configuration. Is the best way to do this via the "Other Linker Flags" setting? If so, what's the syntax for linking in a framework? All I've found is "-weak_framework" but I'm not 100% convinced that this is the method I should be using. A bit of a description : I have a 3rd party framework, one Debug and one Release. In my own Debug project, I'd like to link against "3rdParty_debug.framework", and in Release link against "3rdParty.framework". I would then just modify the search paths for each Configuration to look in the appropriate 3rd party directory.
Yes, if you don't want Xcode's automatic link-the-framework-that's-included-in-the-target behavior, here's what you do:
1) Remove the framework from your target. You can do this just by Get Info on the framework, going to the Targets tab, and unchecking that target.
2) Add to your target's Framework Search Paths build setting the path to the correct framework for each configuration. If the headers for the Debug and Release frameworks are the same, you don't need to do this; if they're different, you probably need to make sure the frameworks are in separate Build and Release directories, and have different paths to them in your different configurations.
3) Add to your target's Other Linker Flags an entry like "-framework 3rdParty_debug" to each configuration, using the correct full path to the framework for that configuration. If you have other Other Linker Flags defined at the project level, you need to make sure you use $(VALUE) as well, to inherit the flags provided at that level.
Chris |