如何使用Swift 2.3构建Realm? [英] How to build Realm using Swift 2.3?

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

问题描述

我已经将工具链更改为swift 2.3 by

I have already change toolchain to swift 2.3 by

export PATH =/应用程序/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin:"$ {PATH}"

export PATH=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin:"${PATH}"

做了

打开Xcode项目->单击Realm项目-> RealmSwift目标->'Build Settings'选项卡->将Use Legacy Swift Language Version设置为Yes(如果为Swift 2.3构建)或No(如果为Swift 3构建) ).

Open the Xcode project -> Click on the Realm project -> RealmSwift target -> 'Build Settings' tab -> set Use Legacy Swift Language Version to Yes (if building for Swift 2.3) or No (if building for Swift 3).

为Swift 3& Xcode 8 说.

但是我得到的仍然是迅速的3.0版本.

But what I get is still swift 3.0 version.

有什么主意吗?

我查看了build.sh,发现导出路径不像xcrun swift那样工作,领域用来获取swift版本的xcrun swift仍然是2.2或3.0,具体取决于所使用的工具链.

I looked into build.sh and found out the export path doesn't work as in xcrun swift, which was used by realm to get swift version, it was still 2.2 or 3.0, depending which toolchain was used.

推荐答案

要使用Swift 2.3从master分支构建Realm,请在构建时将REALM_SWIFT_VERSION环境变量设置为2.3.例如,要为OS X构建:

To build Realm from the master branch with Swift 2.3, set the REALM_SWIFT_VERSION environment variable to 2.3 when building. For instance, to build for OS X:

REALM_SWIFT_VERSION=2.3 sh build.sh osx

Realm的构建脚本将根据REALM_SWIFT_VERSION环境变量的值来确定要使用哪个Xcode版本,因此无需修改您的PATH变量.

Realm's build scripts will determine which Xcode version to use based on the value of the REALM_SWIFT_VERSION environment variable, so there's no need to modify your PATH variable.

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

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