Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7.3 library project compiles every time

Tags:

xcode

ios

I have a library project that used to build just fine in Xcode 7.2. If I just compiled it, it would rebuild it on subsequent builds. After upgrading to Xcode 7.3, Xcode recompiles all the files on every build even if I make no changes to any file.

I did a deep clean and also deleted the derived data folder to make sure that was not the cause. The dependent library projects build fine (they don't recompile everything) when I compile them independently. I have looked through all the settings but couldn't figure out why this is happening.

I stumbled upon 2 things that "fixed" the problem but I don't want to use any of these "solutions"

  1. I changed the Optimization Level (for LLVM) from None [-O0] to Fastest, Smallest [-Os] and that did the trick. Im not sure why without the optimization it recompiled all the files, all the time (even if it was not changed).

  2. I have a pre-processor flag (DEBUG=1) for debug builds and if I remove that flag then it stops recompiling all the files, all the time

The above 2 options don't work for me.

Has anyone seen similar behavior?

like image 210
RPM Avatar asked Apr 05 '16 23:04

RPM


1 Answers

I figured out the problem. In Xcode one of the Build Settings was not set correctly.

The "C Language Dialect" was set to "GNU99" instead of "Compiler Default". Previously the standard was GNU99 but now its not. At some point Xcode did not migrate the library project settings correctly and so it was set to GNU99. Once I changed it to GNU99 it stopped recompiling all my code every time !

like image 55
RPM Avatar answered Oct 16 '22 18:10

RPM