Re: Different library per build configuration?
Re: Different library per build configuration?
- Subject: Re: Different library per build configuration?
- From: Ken Thomases <email@hidden>
- Date: Tue, 22 Sep 2009 02:50:17 -0500
On 21 sept. 2009, at 21:56, Rippit the Ogg Frog wrote:
I'm building the ZooLib framework as a static library. There is a
libzoo.a for the Debug build configuration, and another libzoo.a for
the release build configuration. They're placed in the usual build
products folders by Xcode:
build/
Debug/
libzoo.a
Release/
libzoo.a
Next I build an application - in this particular case it's a test
harness. It has just one source file, and it links in libzoo.a.
If I include the Debug libzoo.a, and I build my test harness in
debug mode, it works fine.
Now what I would like to do is to include the Release libzoo.a in my
test harness, and link against that - but only when in Release mode.
I think the following will work:
* First, remove all references to libzoo.a from your application project
* Now, add the ZooLib framework project as a cross-project reference
in your application project
* Get Info on your application target and add a Direct Dependency,
choose the ZooLib static library target from the ZooLib cross-project
reference
* Toggle open the cross-project reference in the file list
* Drag the libzoo.a static library "virtual product" from there to
your application target's link build phase
With that set up, your app should link against the static library that
corresponds to the configuration you're building. When you build the
Debug configuration of your app, it will link against the library from
the Debug configuration of ZooLib -- it will build that library, if
necessary. Likewise, the Release build of your app will be linked
against the Release build of libzoo.a.
Cheers,
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden