xcode 如何用Xcode修改并行编译次数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5417835/
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-09-14 20:38:07  来源:igfitidea点击:

how to modify the number of parallel compilation with Xcode

c++xcodebuildparallel-processing

提问by dilig0

How to change the number of parallel compilations when building a C++ project with XCode ?

使用 XCode 构建 C++ 项目时如何更改并行编译的数量?

I am not talking about distributed builds, but on simultaneous compilations of a set of source files from a single project, on a single computer. (currently using Xcode 3.2.4)

我不是在谈论分布式构建,而是在单个计算机上同时编译来自单个项目的一组源文件。(目前使用 Xcode 3.2.4)

Thanks

谢谢

采纳答案by u596219

Adjust the PBXNumberOfParallelBuildSubtasksuser default, for example:

调整PBXNumberOfParallelBuildSubtasks用户默认值,例如:

defaults write com.apple.XCode PBXNumberOfParallelBuildSubtasks 6

回答by Mimika Oh

For Xcode 4 you must set the IDEBuildOperationMaxNumberOfConcurrentCompileTasks user default, for example:

对于 Xcode 4,您必须设置 IDEBuildOperationMaxNumberOfConcurrentCompileTasks 用户默认值,例如:

defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4

Note the "dt". This won't affect xcodebuild on the command line. To do that, use something like

注意“dt”。这不会影响命令行上的 xcodebuild。为此,请使用类似

xcodebuild -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=4 ...

(See http://lists.apple.com/archives/xcode-users/2011/Apr/msg00403.htmland http://lists.apple.com/archives/xcode-users/2011/Jul//msg00377.html)

(参见http://lists.apple.com/archives/xcode-users/2011/Apr/msg00403.htmlhttp://lists.apple.com/archives/xcode-users/2011/Jul//msg00377.html)

回答by J. Peterson

Just for the record - developers at our site using XCode 4 discovered that parallel compilation gets disabled if McAfee anti-virus is installed. Builds that should finish in 15-20 minutes took nearly five hours until McAfee was removed.

只是为了记录 - 我们站点上使用 XCode 4 的开发人员发现,如果安装了 McAfee 防病毒软件,并行编译将被禁用。应该在 15-20 分钟内完成的构建花了将近五个小时,直到 McAfee 被删除。

回答by rvalue

For command line builds, I've tested the 2011/Jul mailing list postthat Mimika linked, and deployed it on our (Xcode 4.2, on Snow Leopard) build server to save memory like so:

对于命令行构建,我测试了Mimika 链接的2011/Jul 邮件列表帖子,并将其部署在我们的(Xcode 4.2,在雪豹上)构建服务器上以节省内存,如下所示:

defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 1

回答by vonlost

I don't know why it drops from four to two, but I also found that quitting Xcode 6, then in Terminal entering "defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4" got me back to four when Xcode is restarted.

我不知道为什么它从 4 降到了 2,但我也发现退出 Xcode 6,然后在终端中输入“defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4”让我在 Xcode 重新启动时回到 4。