Xcode: How to set debug environment with multiple xcconfig files? Xcode: How to set debug environment with multiple xcconfig files? xcode xcode

Xcode: How to set debug environment with multiple xcconfig files?


The way we have tackled this in the past is to have each layer compose a subset of the definitions, then bring them all together at the leaf-level xcconfig.

In shared.xcconfig:

GCC_PREPROCESSOR_DEFINITIONS_SHARED = qFoo qBar qBaz

In debug.xcconfig:

GCC_PREPROCESSOR_DEFINITIONS_DEBUG = qDebugGCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_SHARED) $(GCC_PREPROCESSOR_DEFINITIONS_DEBUG)

(The advantage to making the subset variables verbose is that they are lexicographically similar to the value they are used to compose, making them easier to find in the config file.)


You could also use the following format in a .xcconfig file. (works in xcode 4, not tested in xcode 3 ). Its only an example, seems to works for all settings.

ARCHS=i386 x86_64ARCHS[config=Debug]=i386ARCHS[config=Release]=i386 x86_64


Following should work :

xcodebuild GCC_PREPROCESSOR_DEFINITIONS='$(value) BAR=1'