如何使用xcodebuild构建一个特定的架构? [英] How can I build a specific architecture using xcodebuild?

查看:1634
本文介绍了如何使用xcodebuild构建一个特定的架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有遗留代码依赖于 32位的指针,并希望使用 xCodeBuild 来构建代码从命令行。这不工作,由于某些原因。这里是我使用的命令:

I have legacy code that relies on pointers being 32-bit and want to use xCodeBuild to build that code from command line. This doesn't work for some reason. Here's the command I use:

xcodebuild -configuration Debug -arch i386 
  -workspace MyProject.xcworkspace -scheme MyLib

这是我得到的输出

[BEROR]No architectures to compile for 
  (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).

显然,它试图构建 x86_64 代码失败,因为我只能在xCode项目设置中从 VALID_ARCHS 启用 i386

Clearly it's trying to build x86_64 code and failing miserably since I only enabled i386 from VALID_ARCHS in xCode project settings.

有没有办法让它明白我不想要一个 64位库?

Is there a way to make it understand I don't want a 64-bit library?

推荐答案

如果您想要将 ONLY_ACTIVE_ARCH 设置为 code> xcodebuild 以使用 ARCHS 参数。通过传递这些参数,您可以强制使用正确的架构。

You have to set the ONLY_ACTIVE_ARCH to NO if you want xcodebuild to use the ARCHS parameters. By passing these parameters, you can force the proper architecture.

xcodebuild ARCHS=i386 ONLY_ACTIVE_ARCH=NO -configuration Debug -workspace MyProject.xcworkspace -schema MyLib

请参阅参考资料

这篇关于如何使用xcodebuild构建一个特定的架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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