Ser Pounce
Ser Pounce

Reputation: 14571

New Xcode target: changing configuration settings / preprocessor macros

I just followed some tutorials on creating a new target for a lite version, and everything is working well. One thing I'm worried about is it's mentioned that you need to set configuration to all configurations and am just wondering where to do this in Xcode 4.6 (or do you need to do it anymore)? I'm clicking my target, then build settings, and am not seeing the option that used to be there in the older versions of Xcode.

Also, I've added "LITE_VERSION" to preprocessor macros in build settings and it works fine, but I've seen mentioned in other places that it should be -DLite_VERSION. Does it matter?

The tutorial I was reading was here.

It says to make sure "The configuration dropdown in the info panel is set to “All Configurations”. I've seen this in other tutorials as well, even where one guy said he submitted to the app store without this being set and ads were being shown in his paid version.

Upvotes: 3

Views: 678

Answers (2)

djromero
djromero

Reputation: 19641

If you are using .xcconfig files to set the preprocessor flags, there are two options.

1) Using OTHER_CFLAGS you need -D in front of each definition

OTHER_CFLAGS = $(inherited) -DLITE_VERSION

The list is passed as given to the compiler. It corresponds to "Other C Flags" in Xcode build settings.

2) Using GCC_PREPROCESSOR_DEFINITIONS there is no -D

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) LITE_VERSION

The list is passed through -D flag to the compiler. It corresponds to "Preprocessor Macros" in Xcode build settings.

Both are the same for your purposes.

Answering your real question (hard to discern as the title and the body ask different things), in Xcode 4 there is a small triangle on the left of every build setting. It allows you to set a value for all configurations (when the triangle is pointing right) or for each configuration individually (when the triangle points down). If you use .xcconfig files you can associate different configuration files to each build configuration in the Project > Info > Configurations panel.

Upvotes: 1

xapslock
xapslock

Reputation: 1129

In Target -> build settings -> in the first line you can filter "Basic" or "All", maybe the setting you are looking for is just filtert off.

You can name your preprocessor macros whatever you want, as long as you use the exact definition in your code, like... #ifdef LITE_VERSION

Upvotes: 2

Related Questions