meson.build: attempt to detect WildMidi using pkg-config

The WildMidi project added the pkg-config file in version 0.3.3, but
unfortunately, Debian still doesn't ship it 4 years later:

 https://bugs.debian.org/916631

However, for cross-compiling, the pkg-config file is very helpful.
This commit is contained in:
Max Kellermann 2020-05-27 15:01:54 +02:00
parent 9adda30c38
commit 69f09648a4
2 changed files with 8 additions and 1 deletions

2
NEWS
View File

@ -3,6 +3,8 @@ ver 0.21.24 (not yet released)
- "tagtypes" requires no permissions - "tagtypes" requires no permissions
* database * database
- simple: fix crash when mounting twice - simple: fix crash when mounting twice
* decoder
- wildmidi: attempt to detect WildMidi using pkg-config
* Android * Android
- fix build failure with Android NDK r21 - fix build failure with Android NDK r21
* Windows * Windows

View File

@ -129,7 +129,12 @@ if wavpack_dep.found()
decoder_plugins_sources += 'WavpackDecoderPlugin.cxx' decoder_plugins_sources += 'WavpackDecoderPlugin.cxx'
endif endif
if not get_option('wildmidi').disabled()
wildmidi_dep = dependency('wildmidi', required: get_option('wildmidi'))
endif
if not wildmidi_dep.found()
wildmidi_dep = c_compiler.find_library('WildMidi', required: get_option('wildmidi')) wildmidi_dep = c_compiler.find_library('WildMidi', required: get_option('wildmidi'))
endif
conf.set('ENABLE_WILDMIDI', wildmidi_dep.found()) conf.set('ENABLE_WILDMIDI', wildmidi_dep.found())
if wildmidi_dep.found() if wildmidi_dep.found()
decoder_plugins_sources += 'WildmidiDecoderPlugin.cxx' decoder_plugins_sources += 'WildmidiDecoderPlugin.cxx'