Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.3 builds all swift files twice

Tags:

xcode

swift

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: enter image description here

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?

- Edit -

@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?

like image 670
Albert Bori Avatar asked Apr 16 '15 18:04

Albert Bori


1 Answers

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.

like image 55
Josh Brown Avatar answered Nov 07 '22 19:11

Josh Brown