Adding a Preprocessor Definition via a Xcode Scheme

后端 未结 4 464
刺人心
刺人心 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:14

    Worse case scenario you can do a pre-build script for the scheme. You'll have to include the script for every scheme though:

    I would prefer to attach it to a Configuration:

    Then you can easily add preprocessor macros for the various configurations, like I have here for Debug:

    The _Prefix.pch file is a great place to put macros that effect the whole program, like I have here:

    In my example we're effectively turning off console output when not in debug mode, providing a little speed boost.

提交回复
热议问题