Xcode 7.3库项目每次编译 [英] Xcode 7.3 library project compiles every time

查看:97
本文介绍了Xcode 7.3库项目每次编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于在Xcode 7.2中构建得很好的库项目。如果我刚编译它,它将在后续构建中重建它。升级到Xcode 7.3后,即使我没有对任何文件进行任何更改,Xcode也会重新编译每个构建的所有文件。

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. 我将优化级别(针对LLVM)从无[-O0]更改为最快,最小的[-Os],这就是诀窍。我不知道为什么没有优化它会一直重新编译所有文件(即使它没有改变)。

  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).

我有一个预处理器标志(DEBUG = 1)用于调试版本,如果我删除该标志,则它会一直停止重新编译所有文件

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?

推荐答案

我发现了问题。在Xcode中,其中一个构建设置未正确设置。

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

C语言方言设置为GNU99而不是编译器默认值。以前标准是GNU99,但现在不是。在某些时候,Xcode没有正确地迁移库项目设置,所以它被设置为GNU99。一旦我将其更改为GNU99,它每次都停止重新编译我的所有代码!

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 !

这篇关于Xcode 7.3库项目每次编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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