diff options
author | Akemi <der.richter@gmx.de> | 2018-02-12 16:33:51 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-12 08:29:22 -0800 |
commit | 8762818dd21d06244ab49731af5e88252fb888cf (patch) | |
tree | 5e75bd99b8c0e1925e5bcf70b7037639538a33e2 /waftools | |
parent | c82fed85b985d30806b1982c1f58f50a4edbc3fa (diff) |
build: fix swift detection on major swift versions
the swift version string on major versions only has two components,
major and minor, the third one is missing.
Diffstat (limited to 'waftools')
-rw-r--r-- | waftools/detections/compiler_swift.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/waftools/detections/compiler_swift.py b/waftools/detections/compiler_swift.py index c3b105486a..c1fe06117a 100644 --- a/waftools/detections/compiler_swift.py +++ b/waftools/detections/compiler_swift.py @@ -14,8 +14,8 @@ def __run(cmd): def __add_swift_flags(ctx): ctx.env.SWIFT_FLAGS = ('-frontend -c -sdk %s -enable-objc-interop -emit-objc-header' ' -emit-module -parse-as-library') % (ctx.env.MACOS_SDK) - swift_version = __run(ctx.env.SWIFT + ' -version').split(' ')[3].split('.') - major, minor, sub = [int(n) for n in swift_version] + swift_version = __run(ctx.env.SWIFT + ' -version').split(' ')[3].split('.')[:2] + major, minor = [int(n) for n in swift_version] # the -swift-version parameter is only supported on swift 3.1 and newer if major >= 3 and minor >= 1 or major >= 4: |