将预处理器宏添加到 xcode 6 中的目标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26928622/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Add preprocessor macro to a target in xcode 6
提问by user1051307
Probably this is pretty simple, but I can't find a way to define a preprocessor macro for a target in Xcode 6.
可能这很简单,但我找不到在 Xcode 6 中为目标定义预处理器宏的方法。
回答by JoeFryer
I've done a screenshot to show where it is in Xcode, because it's easier :)
我做了一个截图来显示它在 Xcode 中的位置,因为它更容易:)
- Select project file
- Select the target you want
- Go to Build Settings
- Search for 'preprocessor'
- Add your preprocessor macro either for Debug, Release, or both.
- 选择项目文件
- 选择你想要的目标
- 转到构建设置
- 搜索“预处理器”
- 添加用于调试、发布或两者的预处理器宏。
回答by Irina
In Xcode 9 you have to add a preprocessor macros to Project, not Target. Also don't forget to add "D" as the firs letter. For example, "DDebug", then it works.
在 Xcode 9 中,您必须将预处理器宏添加到 Project,而不是 Target。也不要忘记添加“D”作为第一个字母。例如,“DDebug”,那么它就起作用了。