Skip to content

Commit 31aeb26

Browse files
committed
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.
1 parent be3a7da commit 31aeb26

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

waftools/detections/compiler_swift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __add_swift_flags(ctx):
1515
ctx.env.SWIFT_FLAGS = ('-frontend -c -sdk %s -enable-objc-interop -emit-objc-header'
1616
' -emit-module -parse-as-library') % (ctx.env.MACOS_SDK)
1717
swift_version = __run(ctx.env.SWIFT + ' -version').split(' ')[3].split('.')
18-
major, minor, sub = [int(n) for n in swift_version]
18+
major, minor = [int(n) for n in swift_version]
1919

2020
# the -swift-version parameter is only supported on swift 3.1 and newer
2121
if major >= 3 and minor >= 1 or major >= 4:

0 commit comments

Comments
 (0)