Re: Target dependencies vs. configurations
Re: Target dependencies vs. configurations
- Subject: Re: Target dependencies vs. configurations
- From: James Bucanek <email@hidden>
- Date: Sat, 10 Feb 2007 08:33:09 -0700
James Walker wrote on Friday, February 9, 2007:
>Let's say I have a target that produces a private framework, and another
>target that produces an app that uses that framework.
So far, so good.
>(Maybe these two
>targets are in different projects, I don't know if that matters.)
Yes, it does.
>Now,
>as far as I know, there is no reasonable way to make the app's debug
>configuration link against the debug configuration of the framework, and
>the app's release configuration link against the release configuration
>of the framework,
As far as I know, that's exactly how it works. When you change configurations, it changes configurations for all targets. Product references also change. So the targets that reference a product produced by another target will reference the one that belongs to the current configuration.
Configurations create, essentially, a domain for their output. Everything you do build in the Debug domain is separate from anything built in the Release domain. You can see this in the build folder structure.
>so let's say both configurations of the app link
>against the release version of the framework.
Unless you've done something strange, this shouldn't happen.
>Am I correct that if I
>make the app target depend on the framework target, then building the
>debug configuration of the app will build the debug configuration of the
>framework,
This is correct.
> which does no good?
This statement I don't understand. Xcode does exactly what you're asking for, but then you state that this "does no good?"
Having said all of that, there are caveats when dealing with cross-project dependencies. If a target depends on a target in another project, you need to ensure that the configuration names in both projects are identical. If a matching configuration name in the dependent target's project exists, Xcode will use that configuration (i.e. "Release" and "Release"). But if the configuration names don't match (i.e. "Debug" and "Development") Xcode will use -- if I remember correctly -- the default configuration for the project.
Manipulating configuration names between projects is one way you could build a debug release of your application and like it against the release version of your framework, for example.
There are also other ways of tripping up Xcode. Using absolute file references (which don't change when you change configurations), when you meant to use product references (which do change), can also confuse the situation.
James Bucanek
____________________________________________________________________
Author of Beginning Xcode ISBN: 047175479X
<http://www.beginningxcode.com/>
_______________________________________________
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