Re: Target dependencies vs. configurations
Re: Target dependencies vs. configurations
- Subject: Re: Target dependencies vs. configurations
- From: "James W. Walker" <email@hidden>
- Date: Sun, 11 Feb 2007 12:56:41 -0800
On Feb 10, 2007, at 9:56 PM, Jim Wintermyre wrote:
On Feb 10, 2007, at 2:16 PM, Chris Espinosa wrote:
On Feb 9, 2007, at 4:16 PM, James Walker wrote:
Let's say I have a target that produces a private framework,
and another target that produces an app that uses that
framework. (Maybe these two targets are in different projects,
I don't know if that matters.) 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, so let's say both configurations of the app
link against the release version of the framework. 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, which does no
good?
James B's reply is right on the money -- assuming that a) Xcode is
> actually building both, b) that they're both building to the same
build directory, and c) your configuration names are coherent
between projects. (This happens automatically for two targets
in the same project; if they're separate projects, you must set
up the Build Products Location to be the same for both projects,
and make sure the configuration names are exactly the same).
(b) is the condition I'm usually missing. The particular case
that prompted my post is an open source project that has library/
framework builds in one part of the project hierarchy, and sample
applications in another, and it wouldn't be easy or natural to put
all the builds in one place.
I have a couple cases where I'm in a similar situation, and my
solution was to add a run script phase to the subproject that
creates the framework to copy the output framework to the location
where the app expects it (e.g. /Library/Frameworks/). Similary,
for some static library subprojects I added a run script phase to
copy the output to /tmp, and in the app the static lib location is
set to an absolute path off /tmp.
This still assumes that parent project is set up to automatically
cause the subproject to build the correct version of the library/
framework (i.e. the targets/configs are named the same).
I think I've got it, by combining your suggestion of using a script
phase with Greg Guerin's suggestion to use symlinks. In my app
project, I added a script build phase that creates a symlink in the
configuration build directory that points to the appropriate version
of the framework. It seems to work.
_______________________________________________
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