Adding a Preprocessor Definition via a Xcode Scheme

后端 未结 4 483
刺人心
刺人心 2021-01-04 03:17

I currently have a number of special \"flavors\" of an iPhone application that I need to build. Ideally, I would like to have a scheme for each \"flavor\" and each scheme wo

4条回答
  •  感情败类
    2021-01-04 04:15

    To meet my requirement of allowing schemes to set preprocessor definitions, the best solution I have come up with is to have scheme pre-action and post-action scripts modify a xcconfig file. This file, in turn, updates the build configuration, setting the preprocessor definitions and will even allow me to define preprocessor definitions to conditionally modify the info.plist. If anyone else goes down this route, make sure you take into account how this file is handled by source control.

    This article's question and associated answers was helpful to me: How to append values in xcconfig variables?

提交回复
热议问题