Skip to content

Commit 995a2e1

Browse files
committed
fix: add pthread dependency if either JACK or ALSA support will be compiled in
Signed-off-by: Christopher Arndt <[email protected]>
1 parent c4a86f6 commit 995a2e1

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

meson.build

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ else
2424
jack_dep = disabler()
2525
endif
2626

27-
2827
jack_not_found = jack_dep.found() ? false : true
2928

3029
## From https://github.com/numpy/numpy/blob/main/numpy/meson.build
@@ -65,9 +64,15 @@ else
6564

6665
# API
6766
alsa_dep = dependency('alsa', required: jack_not_found)
68-
threads_dep = dependency('threads')
6967
endif # Platform detection
7068

69+
jack_support = jack_dep.found() and get_option('jack')
70+
alsa_support = host_machine.system() == 'linux' and alsa_dep.found() and get_option('alsa')
71+
coremidi_support = host_machine.system() == 'darwin' and coremidi_dep.found() and get_option('coremidi')
72+
winmm_support = host_machine.system() == 'windows' and winmm_dep.found() and get_option('winmm')
73+
74+
threads_dep = dependency('threads', required: alsa_support or jack_support)
75+
7176
pymod = import('python')
7277
python = pymod.find_installation(get_option('python'), required: true)
7378

@@ -85,9 +90,9 @@ endif
8590
summary({
8691
'Debug messages (verbose)': get_option('verbose'),
8792
'Build for wheel': get_option('wheel'),
88-
'JACK support': jack_dep.found() and get_option('jack'),
89-
'ALSA support': host_machine.system() == 'linux' and alsa_dep.found() and get_option('alsa'),
90-
'CoreMIDI support': host_machine.system() == 'darwin' and coremidi_dep.found() and get_option('coremidi'),
91-
'Window MM support': host_machine.system() == 'windows' and winmm_dep.found() and get_option('winmm'),
93+
'JACK support': jack_support,
94+
'ALSA support': alsa_support,
95+
'CoreMIDI support': coremidi_support,
96+
'Window MM support': winmm_support,
9297
}, section: 'Configuration')
9398

rtmidi/meson.build

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defines = []
44
dependencies = [python.dependency()]
55
link_args = []
66

7-
if host_machine.system() == 'darwin' and coremidi_dep.found() and get_option('coremidi')
7+
if coremidi_support
88
defines += ['-D__MACOSX_CORE__']
99
#defines += ['-frtti']
1010
dependencies += [coremidi_dep]
@@ -15,24 +15,24 @@ if host_machine.system() == 'darwin' and coremidi_dep.found() and get_option('co
1515
]
1616
endif
1717

18-
if host_machine.system() == 'linux'
18+
if alsa_support or jack_support
1919
dependencies += [threads_dep]
2020
endif
2121

22-
if host_machine.system() == 'linux' and alsa_dep.found() and get_option('alsa')
22+
if alsa_support
2323
defines += ['-D__LINUX_ALSA__']
2424
dependencies += [alsa_dep]
2525
endif
2626

27-
if host_machine.system() == 'windows' and get_option('winmm')
27+
if winmm_support
2828
defines += ['-D__WINDOWS_MM__']
2929
if meson.get_compiler('cpp').get_id() != 'gcc'
3030
defines += ['/EHsc']
3131
endif
3232
dependencies += [winmm_dep]
3333
endif
3434

35-
if jack_dep.found() and get_option('jack')
35+
if jack_support
3636
defines += ['-D__UNIX_JACK__', '-DJACK_HAS_PORT_RENAME']
3737
dependencies += [jack_dep]
3838
endif

0 commit comments

Comments
 (0)