ios 如何在 Xcode 中添加两个编译器标志
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12291202/
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
How to add two compiler flags in Xcode
提问by AAV
I would like to add two compiler flags, one for ARC (-fno-objc-arc) and one for warning (-w). Anybody know how to add two compiler flags in the Xcode build phase for a particular file?
我想添加两个编译器标志,一个用于 ARC(-fno-objc-arc),另一个用于警告(-w)。有人知道如何在 Xcode 构建阶段为特定文件添加两个编译器标志吗?
回答by danielbeard
Add the compiler flags under your Project -> Target -> Build Phases, just separate the flags by a space.
在 Project -> Target -> Build Phases 下添加编译器标志,只需用空格分隔标志即可。
回答by iGranDav
In Xcode, clic on your project file to see the pane with your target(s) and then :
在 Xcode 中,单击您的项目文件以查看带有目标的窗格,然后:
- Select the "Build Phases" tab
- Unfold "Compile sources"
- Search for your specific file
- Set your compiler flags on this particular file by double-clik on this column.
- 选择“构建阶段”选项卡
- 展开“编译源”
- 搜索您的特定文件
- 通过双击此列在此特定文件上设置编译器标志。
Hope this helps
希望这可以帮助
回答by Andrey M.
- Select blue project file
- Select "Build phases".
- Disclose "Compile Sources".
- Double click on file that you want to add flags.
- Then set flags separated by space.
- 选择蓝色项目文件
- 选择“构建阶段”。
- 公开“编译源”。
- 双击要添加标志的文件。
- 然后设置以空格分隔的标志。
回答by Jim
Select your project in the project navigator in the left-hand panel, select your target, then select Build Phases. Expand Compile Sourcesand double-click the file you want to set the compiler flag for. Repeat for each target you want the changes to apply to.
在左侧面板的项目导航器中选择您的项目,选择您的目标,然后选择Build Phases。展开编译源并双击要为其设置编译器标志的文件。对要应用更改的每个目标重复此操作。