diff options
author | Akemi <der.richter@gmx.de> | 2018-07-08 16:49:33 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-09-30 23:37:50 +0300 |
commit | 89e52a228cd796e72e4074d0de2e9293c6d7a0b5 (patch) | |
tree | b5bef7f0c1f4b7712abca85ef276a48542a80b47 /waftools/checks/custom.py | |
parent | 46969b449a67717f168cfd75fd662915fb9164e3 (diff) | |
download | mpv-89e52a228cd796e72e4074d0de2e9293c6d7a0b5.tar.bz2 mpv-89e52a228cd796e72e4074d0de2e9293c6d7a0b5.tar.xz |
build: check for Swift version and disable dependencies if needed
(cherry picked from commit 50787acb275dc0465a0cf7234ee8f9bd07f0d4d1)
Diffstat (limited to 'waftools/checks/custom.py')
-rw-r--r-- | waftools/checks/custom.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py index 06a7c70769..1cb133f27c 100644 --- a/waftools/checks/custom.py +++ b/waftools/checks/custom.py @@ -4,7 +4,7 @@ from waflib import Utils import os __all__ = ["check_pthreads", "check_iconv", "check_lua", - "check_cocoa", "check_wl_protocols"] + "check_cocoa", "check_wl_protocols", "check_swift"] pthreads_program = load_fragment('pthreads.c') @@ -111,3 +111,10 @@ def check_cocoa(ctx, dependency_identifier): ]) return res + +def check_swift(ctx, dependency_identifier): + if ctx.env.SWIFT_VERSION: + major = int(ctx.env.SWIFT_VERSION.split('.')[0]) + if major >= 3: + return True + return False |