“架构”与“架构”之间的区别是什么?和“有效架构”在Xcode构建设置? [英] What's the difference between "Architectures" and "Valid Architectures" in Xcode Build Settings?

查看:275
本文介绍了“架构”与“架构”之间的区别是什么?和“有效架构”在Xcode构建设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它们的含义是什么,我可以将它们设置为不同的值吗?

What's the meaning of them and can I set them in different values?

推荐答案

架构是你想要构建的,有效的架构是你可以设想用你的代码库构建的架构。

Architectures are the ones you want to build, valid architectures are the ones you could conceive of building with your codebase.

所以也许你只想为armv7s构建你的二进制文件,但相同的源代码可以编译得很好对于armv7和armv6。所以 VALID_ARCHS = armv6 armv7 armv7s ,但你设置 ARCHS = armv7s ,因为那是你实际上想要的所有使用您的代码构建。

So maybe you only want to build your binary for armv7s, but the same source code would compile fine for armv7 and armv6. So VALID_ARCHS = armv6 armv7 armv7s, but you set ARCHS = armv7s because that's all you actually want to build with your code.

或者,在Apple-ese中:

Or, in Apple-ese:


ARCHS(架构)

ARCHS (Architectures)

以空格分隔的标识符列表。指定二进制文件所针对的体系结构(ABI,处理器模型)。当此构建设置指定多个体系结构时,生成的二进制文件可能包含每个指定体系结构的目标代码。

Space-separated list of identifiers. Specifies the architectures (ABIs, processor models) to which the binary is targeted. When this build setting specifies more than one architecture, the generated binary may contain object code for each of the specified architectures.

和:


VALID_ARCHS(有效架构)

VALID_ARCHS (Valid Architectures)

以空格分隔的标识符列表。指定可以为其构建二进制文件的体系结构。在构建期间,此列表与ARCHS构建设置的值相交;结果列表指定二进制文件可以运行的体系结构。如果生成的体系结构列表为空,则目标不生成二进制文件。

Space-separated list of identifiers. Specifies the architectures for which the binary may be built. During the build, this list is intersected with the value of ARCHS build setting; the resulting list specifies the architectures the binary can run on. If the resulting architecture list is empty, the target generates no binary.

来源:Xcode Build Setting Reference

实际上,你单独留下 VALID_ARCHS 并且不用担心改变它,只是摆弄 ARCHS 设置要构建的体系结构。通常,您将Debug构建设置为 NATIVE_ARCH ,因为您只想为要测试/运行它的机器构建调试版本,并且发布版本为您计划支持的全系列架构。

In practice, you leave VALID_ARCHS alone and don't worry about changing it, and just fiddle with ARCHS to set the architectures you want to build. Typically, you set a Debug build to just NATIVE_ARCH, since you only want to build the debug version for the machine you'll be testing/running it on, and Release builds for the full spectrum of architectures you plan to support.

这篇关于“架构”与“架构”之间的区别是什么?和“有效架构”在Xcode构建设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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