diff --git a/src/decoder/plugins/meson.build b/src/decoder/plugins/meson.build index 0717ef30b..ee34c1bd2 100644 --- a/src/decoder/plugins/meson.build +++ b/src/decoder/plugins/meson.build @@ -36,9 +36,9 @@ if flac_dep.found() ] endif -conf.set('ENABLE_VORBIS_DECODER', libvorbis_dep.found() or libvorbisidec_dep.found()) +conf.set('ENABLE_VORBIS_DECODER', vorbis_dep.found()) conf.set('HAVE_TREMOR', libvorbisidec_dep.found()) -if libvorbis_dep.found() or libvorbisidec_dep.found() +if vorbis_dep.found() decoder_plugins_sources += [ 'VorbisDecoderPlugin.cxx', 'VorbisDomain.cxx', @@ -181,8 +181,7 @@ decoder_plugins = static_library( libopus_dep, libsidplay_dep, libsndfile_dep, - libvorbis_dep, - libvorbisidec_dep, + vorbis_dep, ogg_dep, wavpack_dep, wildmidi_dep, diff --git a/src/lib/xiph/VorbisComments.cxx b/src/lib/xiph/VorbisComments.cxx index 95a04622e..a8929b5e2 100644 --- a/src/lib/xiph/VorbisComments.cxx +++ b/src/lib/xiph/VorbisComments.cxx @@ -29,8 +29,6 @@ #include "util/StringView.hxx" #include "config.h" -#ifdef ENABLE_VORBIS_DECODER - #ifndef HAVE_TREMOR #include #else @@ -65,8 +63,6 @@ VorbisCommentToReplayGain(ReplayGainInfo &rgi, return found; } -#endif /* ENABLE_VORBIS_DECODER */ - static void vorbis_scan_comment(StringView comment, TagHandler &handler) noexcept { diff --git a/src/lib/xiph/meson.build b/src/lib/xiph/meson.build index a2fc382fa..07ef922fb 100644 --- a/src/lib/xiph/meson.build +++ b/src/lib/xiph/meson.build @@ -40,6 +40,7 @@ endif if not libogg_dep.found() and not libflac_dep.found() xiph_dep = dependency('', required: false) ogg_dep = dependency('', required: false) + vorbis_dep = dependency('', required: false) flac_dep = dependency('', required: false) subdir_done() endif @@ -82,6 +83,29 @@ else ogg_dep = dependency('', required: false) endif +if libvorbis_dep.found() or libvorbisidec_dep.found() + vorbis = static_library( + 'vorbis', + 'VorbisComments.cxx', + include_directories: inc, + dependencies: [ + libvorbis_dep, + libvorbisidec_dep, + ], + ) + + vorbis_dep = declare_dependency( + link_with: vorbis, + dependencies: [ + ogg_dep, + libvorbis_dep, + libvorbisidec_dep, + ], + ) +else + vorbis_dep = dependency('', required: false) +endif + if libflac_dep.found() flac = static_library( 'flac',