• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Buildstyles Propogating to sub projects in XCode 1.5 ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buildstyles Propogating to sub projects in XCode 1.5 ?


  • Subject: Re: Buildstyles Propogating to sub projects in XCode 1.5 ?
  • From: Andreas Grosam <email@hidden>
  • Date: Thu, 28 Apr 2005 11:59:54 +0200


On 27.04.2005, at 18:16, Bryan Pietrzak wrote:


On Apr 27, 2005, at 10:55 AM, Dave Camp wrote:

But they don't, not really. Build Styles don't let you bring in debug libraries, or include/exclude source files that are only appropriate for debugging of profiling, etc.

Half correct. You can change what libraries are used by changing the linker flags using build styles.

Hmm, what if I have a vendor supplied library: "libSuperCool.a" and "libDebugSuperCool.a". Last time I wrestled with build styles I couldn't have the deployment style use one library and the debug style use the other. But that was a while ago.

You can specify in the "Other Linker Flags" setting which library you want to link against, additionally to those already specified in the project. That means, do not include the libs libSuperCool respectively libDebugSuperCool in your project, but use the linker options in the build styles instead. Please read the man pages for ld to find out how to specify static/dynamic libraries and search paths.


However, notice that build styles are applied to all targets in your project, so this might not work for a project having several targets (without using advanced tricks).



You can't change what sources are used.

If your debug source files were wrapped with appropriate ifdefs, you could control the inclusion of the source by changing the Preprocessor Macros setting. It's not the exact feature you are asking for, but in some cases it's enough.

Sure there are workarounds, there's always are :) But they tend to be cumbersome and not really best practices. An IDE is supposed to make most things easy and the hard-to-impossible things possible. Xcode tends to mix that up sometimes.

In XCode, you have to use different targets, when you have different sets of sources. This is because there is a 1:1 relationship for a target and its set of sources.


IMHO, managing different variants in two separate targets, isn't that cumbersome:

Firstly, organize your source directory carefully, for instance use separate directories for debug, final and common sources.

In XCode, you can define quickly which sources to be used for certain targets:
In the Targets section, create two targets, xxx and xxx-debug for instance.
In the project section, define appropriate source groups which mirror your well structured source hierarchy.
Drag all the sources and the libraries/frameworks you want to use into the XCode project (don't bother to specify which target).
Then, in the Targets section click the disclosure triangle for each target to open it and drag the corresponding files from the source groups of the project section to the corresponding build phase (Headers, Bundle Resources, Sources, Framework & Libraries, etc.) of each target - respectively remove certain files from there if they are not appropriate for a certain target.


Again notice, that the build style will be applied to all targets.

Andreas

In my opinion, Build Styles are the right idea, just the wrong design. They simply don't always solve the problem they're supposed to solve. Where I come from that's a design problem.

Bryan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ 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
  • Follow-Ups:
    • Re: Buildstyles Propogating to sub projects in XCode 1.5 ?
      • From: Bryan Pietrzak <email@hidden>
References: 
 >Buildstyles Propogating to sub projects in XCode 1.5 ? (From: Andrew Kimpton <email@hidden>)
 >Re: Buildstyles Propogating to sub projects in XCode 1.5 ? (From: Chris Hanson <email@hidden>)
 >Re: Buildstyles Propogating to sub projects in XCode 1.5 ? (From: Bryan Pietrzak <email@hidden>)
 >Re: Buildstyles Propogating to sub projects in XCode 1.5 ? (From: Dave Camp <email@hidden>)
 >Re: Buildstyles Propogating to sub projects in XCode 1.5 ? (From: Bryan Pietrzak <email@hidden>)

  • Prev by Date: Re: XCode 2 availability
  • Next by Date: About Build-phases and code stripping
  • Previous by thread: Re: Buildstyles Propogating to sub projects in XCode 1.5 ?
  • Next by thread: Re: Buildstyles Propogating to sub projects in XCode 1.5 ?
  • Index(es):
    • Date
    • Thread