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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 20:00:25  来源:igfitidea点击:

How to add two compiler flags in Xcode

iphoneiosxcodexcode4

提问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 下添加编译器标志,只需用空格分隔标志即可。

Imgur

伊格

回答by iGranDav

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

在 Xcode 中,单击您的项目文件以查看带有目标的窗格,然后:

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

Hope this helps

希望这可以帮助

回答by Andrey M.

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

回答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。展开编译源并双击要为其设置编译器标志的文件。对要应用更改的每个目标重复此操作。