diff --git meson.build meson.build
index f9fe4e7263..a8b91061a0 100644
--- a/meson.build
+++ b/meson.build
@@ -367,13 +367,10 @@ endif
 dependencies += cc.find_library('atomic', required: false)
 
 cplugins = get_option('cplugins').require(
-    win32 or (features['libdl'] and cc.has_link_argument('-rdynamic')),
+    win32 or features['libdl'],
     error_message: 'cplugins not supported by the os or compiler!',
 )
 features += {'cplugins': cplugins.allowed()}
-if features['cplugins'] and not win32
-    link_flags += '-rdynamic'
-endif
 
 win32_threads = get_option('win32-threads').require(win32)
 
@@ -414,6 +411,7 @@ add_project_link_arguments(link_flags, language: ['c', 'cpp', 'objc'])
 if darwin
     path_source = files('osdep/path-darwin.c')
     timer_source = files('osdep/timer-darwin.c')
+    sources += files('osdep/utils-mac.c')
 endif
 
 cocoa = dependency('appleframeworks', modules: ['Cocoa', 'IOKit', 'QuartzCore'],
@@ -423,9 +421,11 @@ if features['cocoa']
     dependencies += cocoa
     path_source += files('osdep/path-mac.m')
     sources += files('osdep/language-mac.c',
-                     'osdep/utils-mac.c',
-                     'osdep/mac/app_bridge.m',
-                     'player/clipboard/clipboard-mac.m')
+                     'osdep/mac/app_bridge.m')
+    # clipboard-mac.m requires Swift
+    if features.get('swift', false)
+        sources += files('player/clipboard/clipboard-mac.m')
+    endif
     main_fn_source = files('osdep/main-fn-mac.c')
 endif
 
--- a/meson.build	2025-03-26 01:33:27.000000000 +0800
+++ b/meson.build	2025-05-12 04:15:46.000000000 +0800
@@ -1108,12 +1108,12 @@
 features += {'gl': false}
 
 GL = dependency('', required: false)
-if darwin
+if features['x11']
+    GL = dependency('GL', required: get_option('gl-x11'))
+elif darwin
     GL = dependency('appleframeworks', modules: 'OpenGL', required: get_option('gl-cocoa'))
 elif features['win32-desktop']
     GL = dependency('GL', required: get_option('gl-win32'))
-elif features['x11']
-    GL = dependency('GL', required: get_option('gl-x11'))
 endif
 
 gl_cocoa = get_option('gl-cocoa').require(

--- a/meson.build
+++ b/meson.build	2025-12-23 20:22:12.000000000 +0800
@@ -398,6 +398,11 @@
 add_project_arguments(flags_c, language: ['c', 'objc'])
 add_project_link_arguments(link_flags, language: ['c', 'cpp', 'objc'])
 
+if darwin
+    add_languages('objc', native: false)
+    objc_link_flags = ['-isysroot/', '-L/usr/lib']
+    add_project_link_arguments(objc_link_flags, language: ['c', 'objc'])
+endif
 
 # osdep
 if darwin
@@ -1525,148 +1527,6 @@
 endif
 
 
-# macOS features
-macos_sdk_version_py = ''
-if darwin
-    macos_sdk_version_py = find_program(join_paths(source_root, 'TOOLS', 'macos-sdk-version.py'),
-                                                   required: true)
-endif
-
-macos_sdk_path = ''
-macos_sdk_version = '0.0'
-if darwin and macos_sdk_version_py.found()
-    macos_sdk_info = run_command(macos_sdk_version_py, check: true).stdout().split(',')
-    macos_sdk_path = macos_sdk_info[0]
-    macos_sdk_version = macos_sdk_info[1]
-endif
-
-if macos_sdk_path != ''
-    message('Detected macOS sdk path: ' + macos_sdk_path)
-endif
-
-if macos_sdk_version != '0.0'
-    message('Detected macOS SDK: ' + macos_sdk_version)
-    add_languages('objc', native: false)
-    objc_link_flags = ['-isysroot', macos_sdk_path, '-L/usr/lib', '-L/usr/local/lib']
-    add_project_link_arguments(objc_link_flags, language: ['c', 'objc'])
-endif
-
-swift = get_option('swift-build').require(
-    darwin and features['cocoa'],
-    error_message: 'cocoa was not found',
-)
-xcrun = find_program('xcrun', required: swift)
-swift_ver = '0.0'
-if xcrun.found()
-    swift_prog = find_program(run_command(xcrun, '-find', 'swiftc', check: true).stdout().strip())
-    swift_ver_string = run_command(swift_prog, '-version', check: true).stdout()
-    verRe = '''
-#!/usr/bin/env python3
-import re
-import sys
-verRe = re.compile("(?i)version\s?([\d.]+)")
-swift_ver = verRe.search(sys.argv[1]).group(1)
-sys.stdout.write(swift_ver)
-'''
-    swift_ver = run_command(python, '-c', verRe, swift_ver_string, check: true).stdout()
-    message('Detected Swift version: ' + swift_ver)
-endif
-
-swift = get_option('swift-build').require(
-    swift.allowed() 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()}
-
-if features['cocoa'] and not features['swift'] and get_option('cplayer')
-    error('cplayer enabled but no suitable swift version could be found or was disabled!')
-endif
-
-swift_sources = []
-if features['cocoa'] and features['swift']
-    swift_sources += files('osdep/mac/application.swift',
-                           'osdep/mac/app_hub.swift',
-                           'osdep/mac/clipboard.swift',
-                           'osdep/mac/dialog.swift',
-                           'osdep/mac/event_helper.swift',
-                           'osdep/mac/input_helper.swift',
-                           'osdep/mac/log_helper.swift',
-                           'osdep/mac/menu_bar.swift',
-                           'osdep/mac/option_helper.swift',
-                           'osdep/mac/precise_timer.swift',
-                           'osdep/mac/presentation.swift',
-                           'osdep/mac/swift_compat.swift',
-                           'osdep/mac/swift_extensions.swift',
-                           'osdep/mac/type_helper.swift',
-                           'video/out/mac/common.swift',
-                           'video/out/mac/title_bar.swift',
-                           'video/out/mac/view.swift',
-                           'video/out/mac/window.swift')
-endif
-
-macos_10_15_4_features = get_option('macos-10-15-4-features').require(
-    macos_sdk_version.version_compare('>= 10.15.4'),
-    error_message: 'A macos sdk version >= 10.15.4 could not be found!',
-)
-features += {'macos-10-15-4-features': macos_10_15_4_features.allowed()}
-
-macos_11_features = get_option('macos-11-features').require(
-    macos_sdk_version.version_compare('>= 11'),
-    error_message: 'A macos sdk version >= 11 could not be found!',
-)
-features += {'macos-11-features': macos_11_features.allowed()}
-
-macos_11_3_features = get_option('macos-11-3-features').require(
-    macos_sdk_version.version_compare('>= 11.3'),
-    error_message: 'A macos sdk version >= 11.3 could not be found!',
-)
-features += {'macos-11-3-features': macos_11_3_features.allowed()}
-
-macos_12_features = get_option('macos-12-features').require(
-    macos_sdk_version.version_compare('>= 12'),
-    error_message: 'A macos sdk version >= 12 could not be found!',
-)
-features += {'macos-12-features': macos_12_features.allowed()}
-
-macos_cocoa_cb = get_option('macos-cocoa-cb').require(
-    features['cocoa'] and features['gl-cocoa'] and features['swift'],
-    error_message: 'Either cocoa, gl-cocoa or swift could not be found!',
-)
-features += {'macos-cocoa-cb': macos_cocoa_cb.allowed()}
-if features['macos-cocoa-cb']
-    swift_sources += files('osdep/mac/libmpv_helper.swift',
-                           'video/out/cocoa_cb_common.swift',
-                           'video/out/mac/gl_layer.swift')
-endif
-if features['cocoa'] and features['vulkan'] and features['swift']
-    swift_sources += files('video/out/mac_common.swift',
-                           'video/out/mac/metal_layer.swift')
-    sources += files('video/out/vulkan/context_mac.m')
-endif
-
-macos_media_player = get_option('macos-media-player').require(
-    features['swift'],
-    error_message: 'Swift was not found!',
-)
-features += {'macos-media-player': macos_media_player.allowed()}
-if features['macos-media-player']
-    swift_sources += files('osdep/mac/remote_command_center.swift')
-endif
-
-macos_touchbar = get_option('macos-touchbar').require(
-    features['cocoa'] and cc.has_header('AppKit/NSTouchBar.h'),
-    error_message: 'Either cocoa could not be found or AppKit/NSTouchBar.h could not be found!',
-)
-features += {'macos-touchbar': macos_touchbar.allowed()}
-if features['macos-touchbar']
-    swift_sources += files('osdep/mac/touch_bar.swift')
-endif
-
-if features['swift'] and swift_sources.length() > 0
-    subdir('osdep/mac')
-endif
-
-
 # manpages
 manpage = 'DOCS/man/mpv.rst'
 rst2man = find_program('rst2man', 'rst2man.py', required: get_option('manpage-build'))
@@ -1892,7 +1752,7 @@
     warning('You are building with optional SDL2 support. If you encounter build issues, try disabling it.')
 endif
 
-summary({'cocoa': features['cocoa'] and features['swift'],
+summary({'cocoa': features['cocoa'],
          'd3d11': features['d3d11'],
          'drm': features['drm'],
          'javascript': features['javascript'],
