【发布时间】:2016-10-13 11:06:47
【问题描述】:
我正在从命令行构建一个项目:
xcodebuild -project ABC.xcodeproj -xcconfig ABC.xcconfig -target "All" -configuration Release
如何让几行代码在一个构建阶段与另一个构建阶段不同?
例如ABC.cpp中是否有可能有这样的东西:
#if TARGET == VST2
MyFunction(); // this will be compiled if and only if we are in VST2 build phase
#endif
如果是这样,如何以及在何处定义TARGET 和VST2?在代码本身(在哪个文件中?)还是在 XCode GUI 中? (在哪个菜单中?)
这是项目的样子,你可以看到目标“All”的“构建阶段”:
【问题讨论】:
-
我猜这取决于构建目标之间的变化
-
只有一两行像
myfunction();@UKMonkey
标签: c++ xcode c-preprocessor