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.)