diff options
author | Dudemanguy <random342@airmail.cc> | 2023-10-21 09:53:54 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-09 18:12:25 +0000 |
commit | a5bf211e128b4fb916edcf5f46bd23d3ff222711 (patch) | |
tree | 12ee77e7630c4995bc2060445936b8bbe1096c57 | |
parent | 051ba909b4107240d643e4793efa2ceb714fd1b4 (diff) | |
download | mpv-a5bf211e128b4fb916edcf5f46bd23d3ff222711.tar.bz2 mpv-a5bf211e128b4fb916edcf5f46bd23d3ff222711.tar.xz |
meson: remove several macos-10-* build options
These have been build options since the waf build, but that doesn't
really make sense. The build can detect whatever macOS sdk version is
available and then use that information to determine whether to enable
the features or not. Potentially disabling multiple sdk versions doesn't
really make any sense. Because f5ca11e12bc55d14bd6895b619c4abfd470c6452
effectively made macOS 10.15 the minimum supported version, we can drop
all of these checks and bump the required sdk version to 10.15. The rest
of the build simplifies from there.
-rw-r--r-- | meson.build | 21 | ||||
-rw-r--r-- | meson_options.txt | 3 | ||||
-rw-r--r-- | osdep/macos/swift_compat.swift | 17 | ||||
-rw-r--r-- | osdep/meson.build | 8 | ||||
-rw-r--r-- | video/out/mac/title_bar.swift | 9 |
5 files changed, 4 insertions, 54 deletions
diff --git a/meson.build b/meson.build index da051b7d91..f9c29cdaa8 100644 --- a/meson.build +++ b/meson.build @@ -1498,23 +1498,8 @@ sys.stdout.write(swift_ver) message('Detected Swift version: ' + swift_ver) endif -macos_10_11_features = get_option('macos-10-11-features').require( - macos_sdk_version.version_compare('>=10.11'), - error_message: 'a suitable macos sdk version could not be found!', -) - -macos_10_12_2_features = get_option('macos-10-12-2-features').require( - macos_sdk_version.version_compare('>=10.12.2'), - error_message: 'a suitable macos sdk version could not be found!', -) - -macos_10_14_features = get_option('macos-10-14-features').require( - macos_sdk_version.version_compare('>=10.14'), - error_message: 'a suitable macos sdk version could not be found!', -) - swift = get_option('swift-build').require( - darwin and macos_sdk_version.version_compare('>=10.10') and swift_ver.version_compare('>=4.1'), + darwin and macos_sdk_version.version_compare('>= 10.15') and swift_ver.version_compare('>= 4.1'), error_message: 'A suitable macos sdk version or swift version could not be found!', ) features += {'swift': swift.allowed()} @@ -1549,8 +1534,8 @@ if features['cocoa'] and features['vulkan'] and features['swift'] endif macos_media_player = get_option('macos-media-player').require( - macos_10_12_2_features.allowed() and features['swift'], - error_message: 'Either the macos sdk version is not at least 10.12.2 or swift was not found!', + features['swift'], + error_message: 'Swift was not found!', ) features += {'macos-media-player': macos_media_player.allowed()} if features['macos-media-player'] diff --git a/meson_options.txt b/meson_options.txt index f50c55e738..83cb111e82 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -104,9 +104,6 @@ option('videotoolbox-gl', type: 'feature', value: 'auto', description: 'Videotoo option('vulkan-interop', type: 'feature', value: 'auto', description: 'Vulkan graphics interop') # macOS features -option('macos-10-11-features', type: 'feature', value: 'auto', description: 'macOS 10.11 SDK Features') -option('macos-10-12-2-features', type: 'feature', value: 'auto', description: 'macOS 10.12.2 SDK Features') -option('macos-10-14-features', type: 'feature', value: 'auto', description: 'macOS 10.14 SDK Features') option('macos-cocoa-cb', type: 'feature', value: 'auto', description: 'macOS libmpv backend') option('macos-media-player', type: 'feature', value: 'auto', description: 'macOS Media Player support') option('macos-touchbar', type: 'feature', value: 'auto', description: 'macOS Touch Bar support') diff --git a/osdep/macos/swift_compat.swift b/osdep/macos/swift_compat.swift index 24c00b0ae1..1c8f28f810 100644 --- a/osdep/macos/swift_compat.swift +++ b/osdep/macos/swift_compat.swift @@ -15,23 +15,6 @@ * License along with mpv. If not, see <http://www.gnu.org/licenses/>. */ -#if !HAVE_MACOS_10_14_FEATURES -extension NSAppearance.Name { - static let darkAqua: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameDarkAqua") - static let accessibilityHighContrastAqua: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityAqua") - static let accessibilityHighContrastDarkAqua: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityDarkAqua") - static let accessibilityHighContrastVibrantLight: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantLight") - static let accessibilityHighContrastVibrantDark: NSAppearance.Name = NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantDark") -} - -@available(OSX 10.12, *) -extension String { - static let RGBA16Float: String = kCAContentsFormatRGBA16Float - static let RGBA8Uint: String = kCAContentsFormatRGBA8Uint - static let gray8Uint: String = kCAContentsFormatGray8Uint -} -#endif - extension NSPasteboard.PasteboardType { static let fileURLCompat: NSPasteboard.PasteboardType = { if #available(OSX 10.13, *) { diff --git a/osdep/meson.build b/osdep/meson.build index 60fc2f6d57..21baafccdd 100644 --- a/osdep/meson.build +++ b/osdep/meson.build @@ -19,14 +19,6 @@ if get_option('optimization') != '0' swift_flags += '-O' endif -if macos_10_11_features.allowed() - swift_flags += ['-D', 'HAVE_MACOS_10_11_FEATURES'] -endif - -if macos_10_14_features.allowed() - swift_flags += ['-D', 'HAVE_MACOS_10_14_FEATURES'] -endif - extra_flags = get_option('swift-flags').split() swift_flags += extra_flags diff --git a/video/out/mac/title_bar.swift b/video/out/mac/title_bar.swift index e49c2bb99c..945c8f371b 100644 --- a/video/out/mac/title_bar.swift +++ b/video/out/mac/title_bar.swift @@ -200,11 +200,7 @@ class TitleBar: NSVisualEffectView { return NSAppearance(named: .accessibilityHighContrastVibrantDark) case "0", "auto": fallthrough default: -#if HAVE_MACOS_10_14_FEATURES return nil -#else - break -#endif } } @@ -221,7 +217,6 @@ class TitleBar: NSVisualEffectView { default: break } -#if HAVE_MACOS_10_11_FEATURES if #available(macOS 10.11, *) { switch string { case "2,", "menu": return .menu @@ -232,8 +227,7 @@ class TitleBar: NSVisualEffectView { default: break } } -#endif -#if HAVE_MACOS_10_14_FEATURES + if #available(macOS 10.14, *) { switch string { case "5,", "headerView": return .headerView @@ -248,7 +242,6 @@ class TitleBar: NSVisualEffectView { default: break } } -#endif return .titlebar } |