summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 17:02:06 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-07-05 19:04:00 +0200
commit00997484f1127c96ed4080aaec33745b0f10badf (patch)
tree8e639ea4fddd73d2f4be0655d6a56e10b487a2a4 /wscript
parentea556e5398e7281a0874bc3ba634a1b76d79a35d (diff)
downloadmpv-00997484f1127c96ed4080aaec33745b0f10badf.tar.bz2
mpv-00997484f1127c96ed4080aaec33745b0f10badf.tar.xz
build: allow compilation without any atomics
Not all compilers on all platforms have atomics available (even if they could, technically speaking). We don't use atomics that much, only the following things rely on it: 1. the audio pull code, and all audio outputs using it 2. updating global msg levels 3. reading log messages through the client API Just disable 1. and 3. if atomics are not available. For 2., using fake- atomics isn't too bad; at worst, message levels won't properly update under certain situations (but most likely, it will work just fine). This means if atomics are not available, the client API function mpv_request_log_messages() will do nothing. CC: @mpv-player/stable
Diffstat (limited to 'wscript')
-rw-r--r--wscript11
1 files changed, 7 insertions, 4 deletions
diff --git a/wscript b/wscript
index b4550a88ec..bb55ba411e 100644
--- a/wscript
+++ b/wscript
@@ -138,12 +138,10 @@ main_dependencies = [
'test = __sync_add_and_fetch(&test, 1)'),
'deps_neg': [ 'stdatomic', 'atomic-builtins' ],
}, {
- 'name': 'thread-synchronization-builtins',
+ 'name': 'atomics',
'desc': 'compiler support for usable thread synchronization built-ins',
'func': check_true,
'deps_any': ['stdatomic', 'atomic-builtins', 'sync-builtins'],
- 'req': True,
- 'fmsg': 'your compiler must support either __atomic or __sync built-ins',
}, {
'name': 'librt',
'desc': 'linking with -lrt',
@@ -419,11 +417,13 @@ audio_output_features = [
{
'name': '--sdl2',
'desc': 'SDL2',
+ 'deps': ['atomics'],
'func': check_pkg_config('sdl2'),
'default': 'disable'
}, {
'name': '--sdl1',
'desc': 'SDL (1.x)',
+ 'deps': ['atomics'],
'deps_neg': [ 'sdl2' ],
'func': check_pkg_config('sdl'),
'default': 'disable'
@@ -478,12 +478,13 @@ audio_output_features = [
}, {
'name': '--portaudio',
'desc': 'PortAudio audio output',
- 'deps': [ 'pthreads' ],
+ 'deps': [ 'atomics' ],
'func': check_pkg_config('portaudio-2.0', '>= 19'),
'default': 'disable',
}, {
'name': '--jack',
'desc': 'JACK audio output',
+ 'deps': ['atomics'],
'func': check_pkg_config('jack'),
}, {
'name': '--openal',
@@ -497,6 +498,7 @@ audio_output_features = [
}, {
'name': '--coreaudio',
'desc': 'CoreAudio audio output',
+ 'deps': ['atomics'],
'func': check_cc(
fragment=load_fragment('coreaudio.c'),
framework_name=['CoreFoundation', 'CoreAudio', 'AudioUnit', 'AudioToolbox'])
@@ -507,6 +509,7 @@ audio_output_features = [
}, {
'name': '--wasapi',
'desc': 'WASAPI audio output',
+ 'deps': ['atomics'],
'func': check_cc(fragment=load_fragment('wasapi.c'), lib='ole32'),
}
]