diff options
author | Dudemanguy <random342@airmail.cc> | 2023-10-29 11:15:44 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-29 19:48:43 +0000 |
commit | 18885917a756bd37ee8e5e7fa35a5ed862485cbe (patch) | |
tree | a5cca2e570ce9b22afbbfce7cb516eaebc1aa8a4 /TOOLS | |
parent | 50187264fae1e000d0b72663f6c5f45a4980a81f (diff) | |
download | mpv-18885917a756bd37ee8e5e7fa35a5ed862485cbe.tar.bz2 mpv-18885917a756bd37ee8e5e7fa35a5ed862485cbe.tar.xz |
meson: do the macos sdk version comparison in meson
Since we can no longer rely on distuils for a version comparison, let's
modify the macos-sdk-version script so it returns multiple potential
versions to meson. Then use meson's built-in version comparison to pick
the right one instead. This avoids the complication of needing certain
python packages installed since everything simply uses stdlib functions.
Diffstat (limited to 'TOOLS')
-rwxr-xr-x | TOOLS/macos-sdk-version.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/TOOLS/macos-sdk-version.py b/TOOLS/macos-sdk-version.py index ae1d355539..fc800fb67e 100755 --- a/TOOLS/macos-sdk-version.py +++ b/TOOLS/macos-sdk-version.py @@ -1,24 +1,23 @@ #!/usr/bin/env python3 -# Logic copied from compiler_swift.py in the waf build. This checks for the sdk -# path, the sdk version, and the sdk build version. The sdk path is returned -# along with what is selected as the sdk version. +# This checks for the sdk path, the sdk version, and +# the sdk build version. import re import os import string import sys -from packaging import version from shutil import which from subprocess import check_output def find_macos_sdk(): sdk = os.environ.get('MACOS_SDK', '') sdk_version = os.environ.get('MACOS_SDK_VERSION', '0.0') + build_version = '0.0' xcrun = which('xcrun') if not xcrun: - return sdk,sdk_version + return sdk,sdk_version,build_version if not sdk: sdk = check_output([xcrun, '--sdk', 'macosx', '--show-sdk-path'], @@ -55,13 +54,7 @@ def find_macos_sdk(): if not isinstance(sdk_version, str): sdk_version = '10.10.0' - # pick the higher version, always pick sdk over build if newer - if version.parse(build_version) > version.parse(sdk_version): - return sdk,build_version - else: - return sdk,sdk_version - - return sdk,sdk_version + return sdk,sdk_version,build_version if __name__ == "__main__": sdk_info = find_macos_sdk() |