• 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: Equivalent to xcconfig conditionals available?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Equivalent to xcconfig conditionals available?


  • Subject: Re: Equivalent to xcconfig conditionals available?
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 17 Jun 2008 22:16:07 -0500

On Jun 17, 2008, at 7:26 AM, Mattias Arrelid wrote:

We have some xcconfig files that we use for several of our build
targets. All these config files includes a master xcconfig file with
some default values. Now, it would be nice if this master file, after
all declarations, could have a conditional import depending on some
variable that we are able to set. Let me show you how I want it to
look (in pseudo xcconfig language):

SOME_SETTING_1 = SOME_VALUE_1;
SOME_SETTING_2 = SOME_VALUE_2;
...
...
SOME_SETTING_N-1 = SOME_VALUE_N-1;
SOME_SETTING_N = SOME_VALUE_N;

#ifdef SOMETHING
#include "config_for_something.h"
#else
#include "another_config.h"
#endif

Can I achieve this somehow? The Xcode User Guide doesn't reveal too
much on this, and neither does searching Google and this archive. I
know we could split each target into two targets, but that really
isn't feasible. If one cannot have conditionals, I guess there is no
syntax for checking if a config file is present before inclusion
either?

Rather than "split[ting] each target into two targets", how about using one target with two build configurations?


Rather than having a master xcconfig that conditionally includes a specific sub-configuration xcconfig, I believe it's more typical for there to be specific xcconfig files for each case, which include one generic xcconfig to establish a baseline. So, you'd have:

config_for_something.xcconfig:
#include "generic.xcconfig"
SETTING_SPECIFIC_TO_SOMETHING = SOME_VALUE;

and:

another_config.xcconfig:
#include "generic.xcconfig"
SETTING_SPECIFIC_TO_ANOTHER = SOME_DIFFERENT_VALUE;

Then, one of the build configurations for the target will be based on config_for_something.xcconfig, while another will be based on another_config.xcconfig.

Google uses this sort of approach in their Mac toolbox <http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/XcodeConfig/ >.

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


  • Follow-Ups:
    • Re: Equivalent to xcconfig conditionals available?
      • From: "Mattias Arrelid" <email@hidden>
References: 
 >Equivalent to xcconfig conditionals available? (From: "Mattias Arrelid" <email@hidden>)

  • Prev by Date: Re: Xcode Release vs Debug Differences: Problem with Exception Types
  • Next by Date: Re: What could cause this to fail under MallocScribble?
  • Previous by thread: Re: Equivalent to xcconfig conditionals available?
  • Next by thread: Re: Equivalent to xcconfig conditionals available?
  • Index(es):
    • Date
    • Thread