• 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: Chris Espinosa <email@hidden>
  • Date: Tue, 17 Jun 2008 09:32:55 -0700

On Jun 17, 2008, at 5:26 AM, Mattias Arrelid <email@hidden> wrote:

Hi everyone,

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?

Because of their role in dependency analysis, .xcconfig files don't have dynamic behavior: they can't be altered in the middle of a build or take different evaluation paths.


The traditional way to express build setting variations is as follows:

SETTING_CASE1 = value1;
SETTING_CASE2 = value2;
SETTING = $(SETTING_$(SOMETHING));

When the value of SOMETHING is changed from CASE1 to CASE2, the value of SETTING will be changed from value1 to value2. This is usually sufficient for most conditional builds.

Note that SOMETHING and SETTING are build settings, not C preprocessor macros.

Chris
_______________________________________________
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


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: 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