“嵌入的内容包含 Swift 代码"是什么意思?在 Xcode 6 中构建设置做什么? [英] What does the "Embedded Content Contains Swift Code" build setting in Xcode 6 do?

查看:42
本文介绍了“嵌入的内容包含 Swift 代码"是什么意思?在 Xcode 6 中构建设置做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是构建选项"下的新设置.它有什么作用?我似乎找不到任何关于它的文档.我的猜测是:是否必须在混合的 Objective-C/Swift 应用程序中将其设置为 YES 以告诉 Xcode 链接到 Swift Runtime?

It's a new setting under "Build Options". What does it do? I can't seem to find any documentation about it. My guess is this: Does it have to be set to YES in a mixed Objective-C/Swift app to tell Xcode to link against the Swift Runtime?

推荐答案

链接不需要.此设置仅适用于您拥有依赖于混合源或纯 Swift 目标的纯 Objective-C 目标时.

It does not need to be Yes for linking. This setting is only for when you have a pure Objective-C target that depends on a mixed-source or pure Swift target.

说明:

启用此设置以指示嵌入在目标产品中的内容包含 Swift 代码,以便标准 Swift 库可以包含在产品中.

Enable this setting to indicate that content embedded in a target's product contains Swift code, so that the standard Swift libraries can be included in the product.

也在 Beta 7 的发行说明中:

Also in the release note of Beta 7:

将 Swift 标准库嵌入到一个包中的构建步骤现在只运行应用程序产品类型,并且仅当应用程序本身独立于任何嵌入式内容,包含 Swift 源文件.构建本身不包含的应用程序时Swift 源文件,但嵌入了其他内容,如框架、XPC 服务、应用程序扩展、等确实包含 Swift 代码,您必须设置构建设置嵌入式内容包含Swift 代码" (EMBEDDED_CONTENT_CONTAINS_SWIFT).这样 Swift 库就会包含在应用程序中.

The build step which embeds the Swift standard libraries in a bundle now only runs for application product types, and only if the application itself, independent of any embedded content, contains Swift source files. When building an application that itself does not contain Swift source files, but embeds other content like frameworks, XPC services, app extensions, etc. that do contain Swift code, you must set the build setting "Embedded Content Contains Swift Code" (EMBEDDED_CONTENT_CONTAINS_SWIFT). That way the Swift libraries will be included in the application.

问候

这篇关于“嵌入的内容包含 Swift 代码"是什么意思?在 Xcode 6 中构建设置做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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