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

眉间皱痕 提交于 2019-12-02 17:46:50

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 = qDebug
GCC_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_64
ARCHS[config=Debug]=i386
ARCHS[config=Release]=i386 x86_64
Laxman Battini

Following should work :

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

How about using $(inherited)?

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!