summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-05-27 15:01:54 +0200
committerMax Kellermann <max@musicpd.org>2020-05-27 15:03:16 +0200
commit69f09648a402c6ce63db631026feb5ee757b037e (patch)
tree87bbe3176d00a03932d1dea71e6da4f8bc5da9aa
parent9adda30c38f96bc313a4db1343884b7bb98b23de (diff)
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.
-rw-r--r--NEWS2
-rw-r--r--src/decoder/plugins/meson.build7
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index b4ea4bcf0..64df932ec 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ ver 0.21.24 (not yet released)
- "tagtypes" requires no permissions
* database
- simple: fix crash when mounting twice
+* decoder
+ - wildmidi: attempt to detect WildMidi using pkg-config
* Android
- fix build failure with Android NDK r21
* Windows
diff --git a/src/decoder/plugins/meson.build b/src/decoder/plugins/meson.build
index 50845e4df..ca90cc07d 100644
--- a/src/decoder/plugins/meson.build
+++ b/src/decoder/plugins/meson.build
@@ -129,7 +129,12 @@ if wavpack_dep.found()
decoder_plugins_sources += 'WavpackDecoderPlugin.cxx'
endif
-wildmidi_dep = c_compiler.find_library('WildMidi', required: get_option('wildmidi'))
+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'))
+endif
conf.set('ENABLE_WILDMIDI', wildmidi_dep.found())
if wildmidi_dep.found()
decoder_plugins_sources += 'WildmidiDecoderPlugin.cxx'