From 31aeb26b5480f932f555bbbbc17cb15aa798e22b Mon Sep 17 00:00:00 2001 From: Akemi Date: Mon, 12 Feb 2018 16:33:51 +0100 Subject: [PATCH] build: fix swift detection in major swift versions the swift version string on major versions only has two components, major and minor, the third one is missing. --- waftools/detections/compiler_swift.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waftools/detections/compiler_swift.py b/waftools/detections/compiler_swift.py index c3b105486a0cf..c6aeafe33cc90 100644 --- a/waftools/detections/compiler_swift.py +++ b/waftools/detections/compiler_swift.py @@ -15,7 +15,7 @@ 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] + 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: