Re: Including different libs based on build style
Re: Including different libs based on build style
- Subject: Re: Including different libs based on build style
- From: Steve Hartwell <email@hidden>
- Date: Wed, 25 Aug 2004 23:57:32 -0700
Hi, Mike et al,
On Aug 25, 2004, at 12:25 PM, Mike Pinkerton wrote:
Since the names of the libs are the same, i figure i should just be
able
to change an include path in the build style but that doesn't seem to
work.
On Aug 25, 2004, at 1:50 PM, Bryan Pietrzak wrote:
I asked this same question at WWDC and was told that no, build styles
doesn't support this, you can't do this without two targets at this
time.
On Aug 25, 2004, at 9:23 PM, Scott Tooker wrote:
Nope, the inability to indicate files to include/exclude at the build
style level is a known problem.
Hrmm... months before WWDC I hadn't realized that this was impossible
;-) so I've been using the following fairly simple technique which
seems to WFM (which is along the lines of Dave Camp's suggestion).
The short description of the solution (following Mike's example) is:
add sdebug/foo.a to the target, remove its path from the target's
Library Search Paths, and then add sdebug to the Library Search Paths
in the Development build style and srelease to the Library Search Paths
in the Deployment build style.
With this arrangement, choosing the Development build style will link
against the sdebug/foo.a and (after a Clean) choosing the Deployment
build style will link against the srelease/foo.a, since the /bin/ld
parameter is the same (-lfoo) but the Library Search Paths are now
build-style dependent.
Unless I'm misunderstanding the problem :-O (well, it *is* late... :-)
Details follow:
1. First I add sdebug/foo.a to my target. I also add srelease/foo.a
to my project (for reference), but do not add it to the target. [You
have to add the debug version, not the release version, to the target
to make ZeroLink happy.]
2. Next I do a "Get Info" on the target, select the "Build" tab and
locate the "Library Search Paths" setting. This setting will now have
the full path of the directory leading to the sdebug/foo.a that I just
added (looking something like /Users/hartwell/dev/proj/.../sdebug), and
I remove it, and close the info window.
3. I then do a "Get Info" on the project, select the "Styles" tab, and
choose the "Development" build style. In the "Library Search Paths"
setting, I add the path to the directory leading to the sdebug version
of the library, which in Mike's example can be expressed simply as
"sdebug" since it's at the top the project directory. I also append a
space and "$(value)" so it will also find any target-specific
libraries, if there are any.
4. I then switch to the "Deployment" build style and add the path to
the directory leading to the srelease version of the library, in this
case simply "srelease". Again, followed by space and "$(value)".
Note that if you add more sdebug/bar.a, etc, libraries to the target,
you have to remember to go back and clean out the target's "Library
Search Paths" again, since Xcode will add them back each time a library
is added.
I thought it was supposed to work this way :-)
Best regards,
Steve Hartwell
p.s. I have a tiny sample project which does this, and also uses build
variants so I don't have to remember to Clean between builds; contact
me offlist if you'd like a zipped copy.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.