Xcode 6.3 两次构建所有 swift 文件 [英] Xcode 6.3 builds all swift files twice

查看:21
本文介绍了Xcode 6.3 两次构建所有 swift 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到 Xcode 6.3,并试图将编译时间减少到可管理的程度.我的项目中有大约 120 个 swift 文件/类,编译需要 2-3 分钟.我的项目还有两个测试目标:UnitTestsAutomatedTests.

I just upgraded to Xcode 6.3, and am attempting to reduce the compile time to something manageable. I have ~120 swift files/classes in my project and it's taking 2-3 minutes to compile. My project also has two test targets: UnitTests and AutomatedTests.

这是我构建时发生的情况的快照:

Here's a snapshot of what's going on when I build:

在每个编译 Swift 源文件"下,它编译了每个 Swift 文件.我看着它发生.

Under each of those "Compile Swift source files" it compiled every single Swift file. I watched it as it happened.

为什么要编译两次,我该如何停止?

Why would it be compiling everything twice, and how do I stop it?

- 编辑 -

@matt 指出它为每个架构构建一次.我假设这对于开发(在模拟器中运行)来说不是必需的.关于如何仅为目标设备构建合适的架构有什么建议吗?

@matt points out that it's building once for each architecture. I'm assuming this isn't necessary for development (running in simulator). Any suggestions on how to only build appropriate architectures for the target device?

推荐答案

将调试和任何其他非发布配置的仅构建活动架构设置从更改为是的.您希望在为分发而构建时为 Yes,否则将其设置为 No 意味着您的文件不会被编译两次.

Change the Build Active Architecture Only setting for Debug and any other non-Release configuration from No to Yes. You want it to be Yes when you build for distribution, but otherwise having it set to No means your files won't be compiled twice.

这篇关于Xcode 6.3 两次构建所有 swift 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆