summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-11-11 10:18:25 -0600
committerDudemanguy <random342@airmail.cc>2022-11-11 19:47:43 +0000
commitc56d981cc61c443d0c1e5edd3140c362f293bc66 (patch)
tree7af03a66c0118ec12773a67a14994f0b96da92ac
parent8758d96a339d9cdeb856c17180dfafd71bf3c1f4 (diff)
downloadmpv-c56d981cc61c443d0c1e5edd3140c362f293bc66.tar.bz2
mpv-c56d981cc61c443d0c1e5edd3140c362f293bc66.tar.xz
meson: fix macos-touchbar check
Apparently, it is possible for touchbar.m to compile on non-macos machines. Also, the disable switch didn't actually work either. Fix this by using the require() function and making sure that Cocoa (should be apple-only) is found in addition to the compile check passing which is what waf does. Fixes #10847.
-rw-r--r--meson.build14
1 files changed, 5 insertions, 9 deletions
diff --git a/meson.build b/meson.build
index d1c5202dab..af4a6bcd97 100644
--- a/meson.build
+++ b/meson.build
@@ -1530,17 +1530,13 @@ if swift.allowed()
subdir(join_paths('generated', 'osdep'))
endif
-macos_touchbar = {
- 'name': 'macos-touchbar',
- 'deps': dependency('appleframeworks', modules: 'AppKit',
- required: get_option('macos-touchbar')),
- 'fragment': files(join_paths(fragments, 'touchbar.m')),
-}
-features += {'macos-touchbar': cc.compiles(macos_touchbar['fragment'], name: 'macos-touchbar check')}
+macos_touchbar = get_option('macos-touchbar').require(
+ cc.compiles(files(join_paths(fragments, 'touchbar.m')), name: 'macos-touchbar check') and features['cocoa'],
+ error_message: 'Either cocoa could not be found or the macos-touchbar check failed!',
+)
+features += {'macos-touchbar': macos_touchbar.allowed()}
if features['macos-touchbar']
sources += files('osdep/macosx_touchbar.m')
-elif get_option('macos-touchbar').enabled()
- error('macos-touchbar enabled but it could not be found!')
endif