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 f5ca11e12b
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.
This commit is contained in:
Dudemanguy 2023-10-21 09:53:54 -05:00
parent 051ba909b4
commit a5bf211e12
5 changed files with 4 additions and 54 deletions

View File

@ -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']

View File

@ -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')

View File

@ -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, *) {

View File

@ -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

View File

@ -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
}