如何修改 SWIFT_MODULE_NAME? [英] How to modify SWIFT_MODULE_NAME?

查看:34
本文介绍了如何修改 SWIFT_MODULE_NAME?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题说明了一切.我在构建设置中搜索了 SWIFT_MODULE_NAME,但没有任何结果.我也在网上搜索过,有提到这个名字,但是没有关于它是如何定义的信息.此外,我在 Apple 文档中找不到任何提及 SWIFT_MODULE_NAME 的内容.

The title says it all. I've searched in the build settings for SWIFT_MODULE_NAME, and nothing came up. I've also searched online, and there are references to this name, but there is no information on how it is defined. Furthermore, I couldn't find any mention of SWIFT_MODULE_NAME in the Apple Docs.

我确实知道这一点:它用在Objective-C Generated Interface Header Name"构建设置中,可以通过双击设置值来查看:

I do know this: it is used in the "Objective-C Generated Interface Header Name" build setting, and can be viewed by double-clicking on the settings value:

$(SWIFT_MODULE_NAME)-Swift.h

$(SWIFT_MODULE_NAME)-Swift.h

它用于弥合 Objective-C 和 Swift 之间的差距,并且只出现在包含 Swift 文件的项目中,(以及我认为的 Objective-C 文件).截至本文发布时,Xcode 7.3 是最新和最出色的版本.

It is used to bridge the gap between Objective-C and Swift, and appears only for projects that include Swift files, (along with Objective-C files I presume). As of this posting, Xcode 7.3 is the latest and greatest.

但是,这个值是在哪里定义的,我该如何修改它?

But, where is this value defined, and how do I modify it?

推荐答案

模块名称来自于 Product Module Name 构建设置:

The module name comes from the Product Module Name build setting:

SWIFT_MODULE_NAME 设置显然是隐藏的,但您可以通过查看 Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode 来查看其派生/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/Swift.xcspec:

The SWIFT_MODULE_NAME setting is apparently hidden, but you can see its derivation by looking at Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/Swift.xcspec:

...
{
    Name = "SWIFT_MODULE_NAME";
    Type = String;
    DefaultValue = "$(PRODUCT_MODULE_NAME)";
    CommandLineArgs = (
        "-module-name",
        "$(value)",
    );
},
...

这篇关于如何修改 SWIFT_MODULE_NAME?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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