Skip to content

Commit

Permalink
build: fix swift detection in major swift versions
Browse files Browse the repository at this point in the history
the swift version string on major versions only has two components,
major and minor, the third one is missing.
  • Loading branch information
Akemi committed Feb 12, 2018
1 parent be3a7da commit 31aeb26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion waftools/detections/compiler_swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 31aeb26

Please sign in to comment.