如何在Xcode中添加两个编译器标志

[英]How to add two compiler flags in Xcode


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构建阶段添加两个编译器标志吗?

4 个解决方案

#1


24  

Add the compiler flags under your Project -> Target -> Build Phases, just separate the flags by a space.

在Project - > Target - > Build Phases下添加编译器标志,只需用空格分隔标志。

Imgur

#2


5  

In Xcode, clic on your project file to see the pane with your target(s) and then :

在Xcode中,clic在项目文件中查看包含目标的窗格,然后:

  1. Select the "Build Phases" tab
  2. 选择“构建阶段”选项卡
  3. Unfold "Compile sources"
  4. 展开“编译源”
  5. Search for your specific file
  6. 搜索您的特定文件
  7. Set your compiler flags on this particular file by double-clik on this column.
  8. 通过此列上的双重clik在此特定文件上设置编译器标志。

Hope this helps

希望这可以帮助

#3


0  

Select your project in the project navigator in the left-hand panel, select your target, then select Build Phases. Expand Compile Sources and 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。展开“编译源”,然后双击要为其设置编译器标志的文件。对要应用更改的每个目标重复此操作。

#4


0  

  1. Select blue project file
  2. 选择蓝色项目文件
  3. Select "Build phases".
  4. 选择“构建阶段”。
  5. Disclose "Compile Sources".
  6. 披露“编译来源”。
  7. Double click on file that you want to add flags.
  8. 双击要添加标志的文件。
  9. Then set flags separated by space.
  10. 然后设置由空格分隔的标志。

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2012/09/05/87dd3994f4981940093baedc155d1efe.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号