summaryrefslogtreecommitdiffstats
path: root/waftools/checks/custom.py
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-11-24 12:49:55 +0100
committerJan Ekström <jeebjp@gmail.com>2019-04-02 01:43:54 +0300
commita3e6b81305ea1e7bf78aec6a83b64fd6071a9440 (patch)
tree2f4ea46588b75b9ba0a0148bc67d1848c1aef46f /waftools/checks/custom.py
parentde2b1920f33f8c81c1de2b1babcc76e8bce4576a (diff)
downloadmpv-a3e6b81305ea1e7bf78aec6a83b64fd6071a9440.tar.bz2
mpv-a3e6b81305ea1e7bf78aec6a83b64fd6071a9440.tar.xz
build: use StrictVersion for swift version comparison
Diffstat (limited to 'waftools/checks/custom.py')
-rw-r--r--waftools/checks/custom.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py
index 8cc701f7f7..678232cf2b 100644
--- a/waftools/checks/custom.py
+++ b/waftools/checks/custom.py
@@ -1,6 +1,7 @@
from waftools import inflector
from waftools.checks.generic import *
from waflib import Utils
+from distutils.version import StrictVersion
import os
__all__ = ["check_pthreads", "check_iconv", "check_lua",
@@ -114,9 +115,8 @@ def check_cocoa(ctx, dependency_identifier):
def check_swift(ctx, dependency_identifier):
if ctx.env.SWIFT_VERSION:
- major = int(ctx.env.SWIFT_VERSION.split('.')[0])
ctx.add_optional_message(dependency_identifier,
- 'version found: ' + ctx.env.SWIFT_VERSION)
- if major >= 3:
+ 'version found: ' + str(ctx.env.SWIFT_VERSION))
+ if StrictVersion(ctx.env.SWIFT_VERSION) >= StrictVersion("3.0"):
return True
return False