如何让Xcode 3.2.3构建一个特定的架构? [英] How to make Xcode 3.2.3 build a specfic architecture?
问题描述
包含静态库时出现以下错误:
I'm getting the following error when including static libraries:
缺少
文件中所需的架构i386
missing required architecture i386 in file
之前30秒工作,只有当我升级到Xcode 3.2.3时失败。我用file命令来检查 - 是的,XCode正在构建完全错误的架构(armv6 + armv7而不是i386)。
This worked 30 seconds previously, and only failed when I upgraded to Xcode 3.2.3. I've used "file" command to check - and, yes, XCode is building completely the wrong architecture (armv6 + armv7 instead of i386).
这似乎是最新Xcode中的一个主要错误,Apple重新编写了构建/编译/链接设置。在发行说明中有一个注释,非常模糊地说他们改变了它,因为它曾经令人困惑。这没用。
This seems to be a major bug in latest Xcode, where Apple has re-written the build / compile / link settings. There's a note in the release notes saying very vaguely that they've "Changed it" because it used to be "confusing". This is not helpful.
图书馆的构建设置很清楚地说:
The build settings for the library VERY clearly say:
有效的体系结构:i386
"Valid architectures: i386"
这里没有混淆 - Xcode正在构建除目标所说的内容以外的东西。
There's no confusion here - Xcode is building something other than what the target says it should.
问题是:你如何取消这个?你如何强迫Xcode做它应该做的事情?我从头开始重新安装Xcode,清理所有内容,并手动检查构建文件。没有什么不对(当然,它在xcode 3.2.2中完美运行)
The question is: how do you un-break this? How do you force Xcode to do what it's supposed to? I've re-installed Xcode from scratch, cleaned everything, and manually inspected the build files. There's nothing wrong (and, of course, it worked perfectly in xcode 3.2.2)
推荐答案
经过大量研究,我相信答案是:
After considerable research, I believe the answer is:
现在这是不可能的 - Apple故意硬编码XCode来忽略构建设置
"this is now impossible - Apple has deliberately hard-coded XCode to ignore build settings"
但是,我想出了一个脚本,可以自动构建项目的所有平台(你必须使用静态库 - 你现在没有太多选择,因为Apple已经禁用了目标),并且脚本很容易被修改为完成所有目标,而不是所有平台:
However, I've come up with a script that automatically builds ALL platforms of a project (which you HAVE to do with static libraries - you don't have much choice now, because Apple has disabled Targets), and the script could easily be modified to do all targets, instead of all platforms:
这篇关于如何让Xcode 3.2.3构建一个特定的架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!