mirror of https://github.com/mpv-player/mpv
build: fix macOS arm builds
remove the hardcoded swift target version and move the version restriction to configure. this was a bad idea anyway and could lead to mismatched object files between obj-c and swift. fix travis 10.12 legacy build. also update the SDK version parser to handle the new macOS 11 scheme. Fixes #8281
This commit is contained in:
parent
959097c880
commit
5ae6f04d6b
|
@ -39,6 +39,10 @@ matrix:
|
||||||
osx_image: xcode10.1
|
osx_image: xcode10.1
|
||||||
- <<: *mac
|
- <<: *mac
|
||||||
osx_image: xcode9.2
|
osx_image: xcode9.2
|
||||||
|
env:
|
||||||
|
- HOMEBREW_NO_AUTO_UPDATE=1
|
||||||
|
- HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||||
|
- CI_SWIFT_FLAGS="\-target x86_64-apple-macosx10.12"
|
||||||
- os: freebsd
|
- os: freebsd
|
||||||
compiler: clang
|
compiler: clang
|
||||||
- os: linux
|
- os: linux
|
||||||
|
|
|
@ -19,7 +19,8 @@ PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" pytho
|
||||||
--variant="${MPV_VARIANT}" \
|
--variant="${MPV_VARIANT}" \
|
||||||
--prefix="${MPV_INSTALL_PREFIX}" \
|
--prefix="${MPV_INSTALL_PREFIX}" \
|
||||||
--enable-{gl,iconv,lcms2,libmpv-shared,lua,jpeg,plain-gl,zlib} \
|
--enable-{gl,iconv,lcms2,libmpv-shared,lua,jpeg,plain-gl,zlib} \
|
||||||
--enable-{cocoa,coreaudio,gl-cocoa,macos-cocoa-cb,macos-touchbar,videotoolbox-gl}
|
--enable-{cocoa,coreaudio,gl-cocoa,macos-cocoa-cb,macos-touchbar,videotoolbox-gl} \
|
||||||
|
--swift-flags="${CI_SWIFT_FLAGS}"
|
||||||
|
|
||||||
python3 ./waf build --variant="${MPV_VARIANT}" -j4
|
python3 ./waf build --variant="${MPV_VARIANT}" -j4
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ def __add_swift_flags(ctx):
|
||||||
ctx.env.SWIFT_FLAGS = [
|
ctx.env.SWIFT_FLAGS = [
|
||||||
"-frontend", "-c", "-sdk", ctx.env.MACOS_SDK,
|
"-frontend", "-c", "-sdk", ctx.env.MACOS_SDK,
|
||||||
"-enable-objc-interop", "-emit-objc-header", "-parse-as-library",
|
"-enable-objc-interop", "-emit-objc-header", "-parse-as-library",
|
||||||
"-target", "x86_64-apple-macosx10.10"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
verRe = re.compile("(?i)version\s?([\d.]+)")
|
verRe = re.compile("(?i)version\s?([\d.]+)")
|
||||||
|
@ -150,7 +149,7 @@ def __find_macos_sdk(ctx):
|
||||||
# convert build version to a version string
|
# convert build version to a version string
|
||||||
# first 2 two digits are the major version, starting with 15 which is 10.11 (offset of 4)
|
# first 2 two digits are the major version, starting with 15 which is 10.11 (offset of 4)
|
||||||
# 1 char is the minor version, A => 0, B => 1 and ongoing
|
# 1 char is the minor version, A => 0, B => 1 and ongoing
|
||||||
# las digits are bugfix version, which are nor relevant for us
|
# last digits are bugfix version, which are not relevant for us
|
||||||
# eg 16E185 => 10.12.4, 17A360 => 10.13, 18B71 => 10.14.1
|
# eg 16E185 => 10.12.4, 17A360 => 10.13, 18B71 => 10.14.1
|
||||||
if sdk_build_version and isinstance(sdk_build_version, str):
|
if sdk_build_version and isinstance(sdk_build_version, str):
|
||||||
verRe = re.compile("(\d+)(\D+)(\d+)")
|
verRe = re.compile("(\d+)(\D+)(\d+)")
|
||||||
|
@ -158,6 +157,9 @@ def __find_macos_sdk(ctx):
|
||||||
major = int(version_parts.group(1)) - 4
|
major = int(version_parts.group(1)) - 4
|
||||||
minor = string.ascii_lowercase.index(version_parts.group(2).lower())
|
minor = string.ascii_lowercase.index(version_parts.group(2).lower())
|
||||||
build_version = '10.' + str(major) + '.' + str(minor)
|
build_version = '10.' + str(major) + '.' + str(minor)
|
||||||
|
# from 20 onwards macOS 11.0 starts
|
||||||
|
if int(version_parts.group(1)) >= 20:
|
||||||
|
build_version = '11.' + str(minor)
|
||||||
|
|
||||||
if not isinstance(sdk_version, str):
|
if not isinstance(sdk_version, str):
|
||||||
sdk_version = '10.10.0'
|
sdk_version = '10.10.0'
|
||||||
|
|
2
wscript
2
wscript
|
@ -182,7 +182,7 @@ main_dependencies = [
|
||||||
'name': '--swift',
|
'name': '--swift',
|
||||||
'desc': 'macOS Swift build tools',
|
'desc': 'macOS Swift build tools',
|
||||||
'deps': 'os-darwin',
|
'deps': 'os-darwin',
|
||||||
'func': check_swift,
|
'func': compose_checks(check_swift, check_macos_sdk('10.10')),
|
||||||
}, {
|
}, {
|
||||||
'name': '--uwp',
|
'name': '--uwp',
|
||||||
'desc': 'Universal Windows Platform',
|
'desc': 'Universal Windows Platform',
|
||||||
|
|
Loading…
Reference in New Issue