Commit 8f178401 authored by Max Kellermann's avatar Max Kellermann

*/plugins/meson.build: define feature macros in Features.h

This makes ccache more efficient when recompiling with different plugins.
parent 8c1d7887
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "neighbor/NeighborPlugin.hxx" #include "neighbor/NeighborPlugin.hxx"
#endif #endif
#include "encoder/Features.h"
#ifdef ENABLE_ENCODER #ifdef ENABLE_ENCODER
#include "encoder/EncoderList.hxx" #include "encoder/EncoderList.hxx"
#include "encoder/EncoderPlugin.hxx" #include "encoder/EncoderPlugin.hxx"
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "config.h"
#include "ArchiveList.hxx" #include "ArchiveList.hxx"
#include "ArchivePlugin.hxx" #include "ArchivePlugin.hxx"
#include "archive/Features.h"
#include "util/StringUtil.hxx" #include "util/StringUtil.hxx"
#include "plugins/Bzip2ArchivePlugin.hxx" #include "plugins/Bzip2ArchivePlugin.hxx"
#include "plugins/Iso9660ArchivePlugin.hxx" #include "plugins/Iso9660ArchivePlugin.hxx"
......
archive_features = configuration_data()
archive_api = static_library( archive_api = static_library(
'archive_api', 'archive_api',
'ArchiveList.cxx', 'ArchiveList.cxx',
...@@ -10,6 +12,8 @@ archive_api_dep = declare_dependency( ...@@ -10,6 +12,8 @@ archive_api_dep = declare_dependency(
subdir('plugins') subdir('plugins')
configure_file(output: 'Features.h', configuration: archive_features)
conf.set('ENABLE_ARCHIVE', found_archive_plugin) conf.set('ENABLE_ARCHIVE', found_archive_plugin)
if not found_archive_plugin if not found_archive_plugin
archive_glue_dep = dependency('', required: false) archive_glue_dep = dependency('', required: false)
......
...@@ -2,21 +2,21 @@ archive_plugins_sources = [] ...@@ -2,21 +2,21 @@ archive_plugins_sources = []
found_archive_plugin = false found_archive_plugin = false
libiso9660_dep = dependency('libiso9660', required: get_option('iso9660')) libiso9660_dep = dependency('libiso9660', required: get_option('iso9660'))
conf.set('ENABLE_ISO9660', libiso9660_dep.found()) archive_features.set('ENABLE_ISO9660', libiso9660_dep.found())
if libiso9660_dep.found() if libiso9660_dep.found()
archive_plugins_sources += 'Iso9660ArchivePlugin.cxx' archive_plugins_sources += 'Iso9660ArchivePlugin.cxx'
found_archive_plugin = true found_archive_plugin = true
endif endif
libbz2_dep = c_compiler.find_library('bz2', required: get_option('bzip2')) libbz2_dep = c_compiler.find_library('bz2', required: get_option('bzip2'))
conf.set('ENABLE_BZ2', libbz2_dep.found()) archive_features.set('ENABLE_BZ2', libbz2_dep.found())
if libbz2_dep.found() if libbz2_dep.found()
archive_plugins_sources += 'Bzip2ArchivePlugin.cxx' archive_plugins_sources += 'Bzip2ArchivePlugin.cxx'
found_archive_plugin = true found_archive_plugin = true
endif endif
libzzip_dep = dependency('zziplib', version: '>= 0.13', required: get_option('zzip')) libzzip_dep = dependency('zziplib', version: '>= 0.13', required: get_option('zzip'))
conf.set('ENABLE_ZZIP', libzzip_dep.found()) archive_features.set('ENABLE_ZZIP', libzzip_dep.found())
if libzzip_dep.found() if libzzip_dep.found()
archive_plugins_sources += 'ZzipArchivePlugin.cxx' archive_plugins_sources += 'ZzipArchivePlugin.cxx'
found_archive_plugin = true found_archive_plugin = true
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "config.h" #include "config.h"
#include "DecoderList.hxx" #include "DecoderList.hxx"
#include "DecoderPlugin.hxx" #include "DecoderPlugin.hxx"
#include "decoder/Features.h"
#include "PluginUnavailable.hxx" #include "PluginUnavailable.hxx"
#include "Log.hxx" #include "Log.hxx"
#include "config/Data.hxx" #include "config/Data.hxx"
......
decoder_features = configuration_data()
decoder_api = static_library( decoder_api = static_library(
'decoder_api', 'decoder_api',
'DecoderAPI.cxx', 'DecoderAPI.cxx',
...@@ -34,3 +36,5 @@ decoder_glue_dep = declare_dependency( ...@@ -34,3 +36,5 @@ decoder_glue_dep = declare_dependency(
decoder_plugins_dep, decoder_plugins_dep,
], ],
) )
configure_file(output: 'Features.h', configuration: decoder_features)
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "config.h"
#include "SidplayDecoderPlugin.hxx" #include "SidplayDecoderPlugin.hxx"
#include "decoder/Features.h"
#include "../DecoderAPI.hxx" #include "../DecoderAPI.hxx"
#include "tag/Handler.hxx" #include "tag/Handler.hxx"
#include "tag/Builder.hxx" #include "tag/Builder.hxx"
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "config.h"
#include "VorbisDecoderPlugin.h" #include "VorbisDecoderPlugin.h"
#include "OggDecoder.hxx" #include "OggDecoder.hxx"
#include "lib/xiph/VorbisComments.hxx" #include "lib/xiph/VorbisComments.hxx"
...@@ -25,6 +24,7 @@ ...@@ -25,6 +24,7 @@
#include "lib/xiph/OggFind.hxx" #include "lib/xiph/OggFind.hxx"
#include "VorbisDomain.hxx" #include "VorbisDomain.hxx"
#include "../DecoderAPI.hxx" #include "../DecoderAPI.hxx"
#include "decoder/Features.h"
#include "input/InputStream.hxx" #include "input/InputStream.hxx"
#include "input/Reader.hxx" #include "input/Reader.hxx"
#include "OggCodec.hxx" #include "OggCodec.hxx"
......
...@@ -20,12 +20,12 @@ if ffmpeg_dep.found() ...@@ -20,12 +20,12 @@ if ffmpeg_dep.found()
endif endif
adplug_dep = dependency('adplug', required: get_option('adplug')) adplug_dep = dependency('adplug', required: get_option('adplug'))
conf.set('ENABLE_ADPLUG', adplug_dep.found()) decoder_features.set('ENABLE_ADPLUG', adplug_dep.found())
if adplug_dep.found() if adplug_dep.found()
decoder_plugins_sources += 'AdPlugDecoderPlugin.cxx' decoder_plugins_sources += 'AdPlugDecoderPlugin.cxx'
endif endif
conf.set('ENABLE_FLAC', flac_dep.found()) decoder_features.set('ENABLE_FLAC', flac_dep.found())
if flac_dep.found() if flac_dep.found()
decoder_plugins_sources += [ decoder_plugins_sources += [
'FlacDecoderPlugin.cxx', 'FlacDecoderPlugin.cxx',
...@@ -36,8 +36,8 @@ if flac_dep.found() ...@@ -36,8 +36,8 @@ if flac_dep.found()
] ]
endif endif
conf.set('ENABLE_VORBIS_DECODER', vorbis_dep.found()) decoder_features.set('ENABLE_VORBIS_DECODER', vorbis_dep.found())
conf.set('HAVE_TREMOR', libvorbisidec_dep.found()) decoder_features.set('HAVE_TREMOR', libvorbisidec_dep.found())
if vorbis_dep.found() if vorbis_dep.found()
decoder_plugins_sources += [ decoder_plugins_sources += [
'VorbisDecoderPlugin.cxx', 'VorbisDecoderPlugin.cxx',
...@@ -45,7 +45,7 @@ if vorbis_dep.found() ...@@ -45,7 +45,7 @@ if vorbis_dep.found()
] ]
endif endif
conf.set('ENABLE_OPUS', libopus_dep.found()) decoder_features.set('ENABLE_OPUS', libopus_dep.found())
if libopus_dep.found() if libopus_dep.found()
decoder_plugins_sources += [ decoder_plugins_sources += [
'OpusDecoderPlugin.cxx', 'OpusDecoderPlugin.cxx',
...@@ -64,80 +64,80 @@ if xiph_dep.found() ...@@ -64,80 +64,80 @@ if xiph_dep.found()
endif endif
fluidsynth_dep = dependency('fluidsynth', version: '>= 1.1', required: get_option('fluidsynth')) fluidsynth_dep = dependency('fluidsynth', version: '>= 1.1', required: get_option('fluidsynth'))
conf.set('ENABLE_FLUIDSYNTH', fluidsynth_dep.found()) decoder_features.set('ENABLE_FLUIDSYNTH', fluidsynth_dep.found())
if fluidsynth_dep.found() if fluidsynth_dep.found()
decoder_plugins_sources += 'FluidsynthDecoderPlugin.cxx' decoder_plugins_sources += 'FluidsynthDecoderPlugin.cxx'
endif endif
libaudiofile_dep = dependency('audiofile', version: '>= 0.3', required: get_option('audiofile')) libaudiofile_dep = dependency('audiofile', version: '>= 0.3', required: get_option('audiofile'))
conf.set('ENABLE_AUDIOFILE', libaudiofile_dep.found()) decoder_features.set('ENABLE_AUDIOFILE', libaudiofile_dep.found())
if libaudiofile_dep.found() if libaudiofile_dep.found()
decoder_plugins_sources += 'AudiofileDecoderPlugin.cxx' decoder_plugins_sources += 'AudiofileDecoderPlugin.cxx'
endif endif
libfaad_dep = c_compiler.find_library('faad', required: get_option('faad')) libfaad_dep = c_compiler.find_library('faad', required: get_option('faad'))
conf.set('ENABLE_FAAD', libfaad_dep.found()) decoder_features.set('ENABLE_FAAD', libfaad_dep.found())
if libfaad_dep.found() if libfaad_dep.found()
decoder_plugins_sources += 'FaadDecoderPlugin.cxx' decoder_plugins_sources += 'FaadDecoderPlugin.cxx'
endif endif
libgme_dep = c_compiler.find_library('gme', required: get_option('gme')) libgme_dep = c_compiler.find_library('gme', required: get_option('gme'))
conf.set('ENABLE_GME', libgme_dep.found()) decoder_features.set('ENABLE_GME', libgme_dep.found())
if libgme_dep.found() if libgme_dep.found()
decoder_plugins_sources += 'GmeDecoderPlugin.cxx' decoder_plugins_sources += 'GmeDecoderPlugin.cxx'
endif endif
libmad_dep = c_compiler.find_library('mad', required: get_option('mad')) libmad_dep = c_compiler.find_library('mad', required: get_option('mad'))
conf.set('ENABLE_MAD', libmad_dep.found()) decoder_features.set('ENABLE_MAD', libmad_dep.found())
if libmad_dep.found() if libmad_dep.found()
decoder_plugins_sources += 'MadDecoderPlugin.cxx' decoder_plugins_sources += 'MadDecoderPlugin.cxx'
endif endif
libmikmod_dep = dependency('libmikmod', version: '>= 3.2', required: get_option('mikmod')) libmikmod_dep = dependency('libmikmod', version: '>= 3.2', required: get_option('mikmod'))
conf.set('ENABLE_LIBMIKMOD', libmikmod_dep.found()) decoder_features.set('ENABLE_LIBMIKMOD', libmikmod_dep.found())
if libmikmod_dep.found() if libmikmod_dep.found()
decoder_plugins_sources += 'MikmodDecoderPlugin.cxx' decoder_plugins_sources += 'MikmodDecoderPlugin.cxx'
endif endif
libmodplug_dep = dependency('libmodplug', required: get_option('modplug')) libmodplug_dep = dependency('libmodplug', required: get_option('modplug'))
conf.set('ENABLE_MODPLUG', libmodplug_dep.found()) decoder_features.set('ENABLE_MODPLUG', libmodplug_dep.found())
if libmodplug_dep.found() if libmodplug_dep.found()
decoder_plugins_sources += 'ModplugDecoderPlugin.cxx' decoder_plugins_sources += 'ModplugDecoderPlugin.cxx'
endif endif
libmpcdec_dep = c_compiler.find_library('mpcdec', required: get_option('mpcdec')) libmpcdec_dep = c_compiler.find_library('mpcdec', required: get_option('mpcdec'))
conf.set('ENABLE_MPCDEC', libmpcdec_dep.found()) decoder_features.set('ENABLE_MPCDEC', libmpcdec_dep.found())
if libmpcdec_dep.found() if libmpcdec_dep.found()
decoder_plugins_sources += 'MpcdecDecoderPlugin.cxx' decoder_plugins_sources += 'MpcdecDecoderPlugin.cxx'
endif endif
libmpg123_dep = dependency('libmpg123', required: get_option('mpg123')) libmpg123_dep = dependency('libmpg123', required: get_option('mpg123'))
conf.set('ENABLE_MPG123', libmpg123_dep.found()) decoder_features.set('ENABLE_MPG123', libmpg123_dep.found())
if libmpg123_dep.found() if libmpg123_dep.found()
decoder_plugins_sources += 'Mpg123DecoderPlugin.cxx' decoder_plugins_sources += 'Mpg123DecoderPlugin.cxx'
endif endif
libsndfile_dep = dependency('sndfile', required: get_option('sndfile')) libsndfile_dep = dependency('sndfile', required: get_option('sndfile'))
conf.set('ENABLE_SNDFILE', libsndfile_dep.found()) decoder_features.set('ENABLE_SNDFILE', libsndfile_dep.found())
if libsndfile_dep.found() if libsndfile_dep.found()
decoder_plugins_sources += 'SndfileDecoderPlugin.cxx' decoder_plugins_sources += 'SndfileDecoderPlugin.cxx'
endif endif
wavpack_dep = dependency('wavpack', required: get_option('wavpack')) wavpack_dep = dependency('wavpack', required: get_option('wavpack'))
conf.set('ENABLE_WAVPACK', wavpack_dep.found()) decoder_features.set('ENABLE_WAVPACK', wavpack_dep.found())
if wavpack_dep.found() if wavpack_dep.found()
decoder_plugins_sources += 'WavpackDecoderPlugin.cxx' decoder_plugins_sources += 'WavpackDecoderPlugin.cxx'
endif endif
wildmidi_dep = c_compiler.find_library('WildMidi', required: get_option('wildmidi')) wildmidi_dep = c_compiler.find_library('WildMidi', required: get_option('wildmidi'))
conf.set('ENABLE_WILDMIDI', wildmidi_dep.found()) decoder_features.set('ENABLE_WILDMIDI', wildmidi_dep.found())
if wildmidi_dep.found() if wildmidi_dep.found()
decoder_plugins_sources += 'WildmidiDecoderPlugin.cxx' decoder_plugins_sources += 'WildmidiDecoderPlugin.cxx'
endif endif
if not get_option('sidplay').disabled() if not get_option('sidplay').disabled()
libsidplayfp_dep = dependency('libsidplayfp', version: '>= 1.8', required: false) libsidplayfp_dep = dependency('libsidplayfp', version: '>= 1.8', required: false)
conf.set('HAVE_SIDPLAYFP', libsidplayfp_dep.found()) decoder_features.set('HAVE_SIDPLAYFP', libsidplayfp_dep.found())
if libsidplayfp_dep.found() if libsidplayfp_dep.found()
libsidplay_dep = libsidplayfp_dep libsidplay_dep = libsidplayfp_dep
...@@ -156,7 +156,7 @@ if not get_option('sidplay').disabled() ...@@ -156,7 +156,7 @@ if not get_option('sidplay').disabled()
else else
libsidplay_dep = dependency('', required: false) libsidplay_dep = dependency('', required: false)
endif endif
conf.set('ENABLE_SIDPLAY', libsidplay_dep.found()) decoder_features.set('ENABLE_SIDPLAY', libsidplay_dep.found())
if libsidplay_dep.found() if libsidplay_dep.found()
decoder_plugins_sources += 'SidplayDecoderPlugin.cxx' decoder_plugins_sources += 'SidplayDecoderPlugin.cxx'
endif endif
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "config.h" #include "config.h"
#include "EncoderList.hxx" #include "EncoderList.hxx"
#include "EncoderPlugin.hxx" #include "EncoderPlugin.hxx"
#include "encoder/Features.h"
#include "plugins/NullEncoderPlugin.hxx" #include "plugins/NullEncoderPlugin.hxx"
#include "plugins/WaveEncoderPlugin.hxx" #include "plugins/WaveEncoderPlugin.hxx"
#include "plugins/VorbisEncoderPlugin.hxx" #include "plugins/VorbisEncoderPlugin.hxx"
...@@ -28,6 +29,7 @@ ...@@ -28,6 +29,7 @@
#include "plugins/ShineEncoderPlugin.hxx" #include "plugins/ShineEncoderPlugin.hxx"
#include "plugins/LameEncoderPlugin.hxx" #include "plugins/LameEncoderPlugin.hxx"
#include "plugins/TwolameEncoderPlugin.hxx" #include "plugins/TwolameEncoderPlugin.hxx"
#include "decoder/Features.h"
#include <string.h> #include <string.h>
......
conf.set('ENABLE_ENCODER', need_encoder) encoder_features = configuration_data()
encoder_features.set('ENABLE_ENCODER', need_encoder)
if not need_encoder if not need_encoder
encoder_glue_dep = dependency('', required: false) encoder_glue_dep = dependency('', required: false)
...@@ -23,3 +25,5 @@ encoder_glue_dep = declare_dependency( ...@@ -23,3 +25,5 @@ encoder_glue_dep = declare_dependency(
encoder_plugins_dep, encoder_plugins_dep,
], ],
) )
configure_file(output: 'Features.h', configuration: encoder_features)
...@@ -2,7 +2,7 @@ encoder_plugins_sources = [ ...@@ -2,7 +2,7 @@ encoder_plugins_sources = [
'NullEncoderPlugin.cxx', 'NullEncoderPlugin.cxx',
] ]
conf.set('ENABLE_FLAC_ENCODER', flac_dep.found()) encoder_features.set('ENABLE_FLAC_ENCODER', flac_dep.found())
if flac_dep.found() if flac_dep.found()
encoder_plugins_sources += 'FlacEncoderPlugin.cxx' encoder_plugins_sources += 'FlacEncoderPlugin.cxx'
endif endif
...@@ -11,30 +11,30 @@ if libopus_dep.found() ...@@ -11,30 +11,30 @@ if libopus_dep.found()
encoder_plugins_sources += 'OpusEncoderPlugin.cxx' encoder_plugins_sources += 'OpusEncoderPlugin.cxx'
endif endif
conf.set('ENABLE_VORBISENC', libvorbisenc_dep.found()) encoder_features.set('ENABLE_VORBISENC', libvorbisenc_dep.found())
if libvorbisenc_dep.found() if libvorbisenc_dep.found()
encoder_plugins_sources += 'VorbisEncoderPlugin.cxx' encoder_plugins_sources += 'VorbisEncoderPlugin.cxx'
endif endif
liblame_dep = c_compiler.find_library('mp3lame', required: get_option('lame')) liblame_dep = c_compiler.find_library('mp3lame', required: get_option('lame'))
conf.set('ENABLE_LAME', liblame_dep.found()) encoder_features.set('ENABLE_LAME', liblame_dep.found())
if liblame_dep.found() if liblame_dep.found()
encoder_plugins_sources += 'LameEncoderPlugin.cxx' encoder_plugins_sources += 'LameEncoderPlugin.cxx'
endif endif
libtwolame_dep = dependency('twolame', required: get_option('twolame')) libtwolame_dep = dependency('twolame', required: get_option('twolame'))
conf.set('ENABLE_TWOLAME', libtwolame_dep.found()) encoder_features.set('ENABLE_TWOLAME', libtwolame_dep.found())
if libtwolame_dep.found() if libtwolame_dep.found()
encoder_plugins_sources += 'TwolameEncoderPlugin.cxx' encoder_plugins_sources += 'TwolameEncoderPlugin.cxx'
endif endif
libshine_dep = dependency('shine', version: '>= 3.1', required: get_option('shine')) libshine_dep = dependency('shine', version: '>= 3.1', required: get_option('shine'))
conf.set('ENABLE_SHINE', libshine_dep.found()) encoder_features.set('ENABLE_SHINE', libshine_dep.found())
if libshine_dep.found() if libshine_dep.found()
encoder_plugins_sources += 'ShineEncoderPlugin.cxx' encoder_plugins_sources += 'ShineEncoderPlugin.cxx'
endif endif
conf.set('ENABLE_WAVE_ENCODER', get_option('wave_encoder')) encoder_features.set('ENABLE_WAVE_ENCODER', get_option('wave_encoder'))
if get_option('wave_encoder') if get_option('wave_encoder')
encoder_plugins_sources += 'WaveEncoderPlugin.cxx' encoder_plugins_sources += 'WaveEncoderPlugin.cxx'
endif endif
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "Registry.hxx" #include "Registry.hxx"
#include "InputPlugin.hxx" #include "InputPlugin.hxx"
#include "input/Features.h"
#include "plugins/TidalInputPlugin.hxx" #include "plugins/TidalInputPlugin.hxx"
#include "plugins/QobuzInputPlugin.hxx" #include "plugins/QobuzInputPlugin.hxx"
#include "config.h" #include "config.h"
......
input_features = configuration_data()
input_api = static_library( input_api = static_library(
'input_api', 'input_api',
'Error.cxx', 'Error.cxx',
...@@ -54,3 +56,5 @@ input_glue_dep = declare_dependency( ...@@ -54,3 +56,5 @@ input_glue_dep = declare_dependency(
tag_dep, tag_dep,
], ],
) )
configure_file(output: 'Features.h', configuration: input_features)
...@@ -7,7 +7,7 @@ if alsa_dep.found() ...@@ -7,7 +7,7 @@ if alsa_dep.found()
endif endif
libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 10.2+0.93+1', required: get_option('cdio_paranoia')) libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 10.2+0.93+1', required: get_option('cdio_paranoia'))
conf.set('ENABLE_CDIO_PARANOIA', libcdio_paranoia_dep.found()) input_features.set('ENABLE_CDIO_PARANOIA', libcdio_paranoia_dep.found())
if libcdio_paranoia_dep.found() if libcdio_paranoia_dep.found()
input_plugins_sources += 'CdioParanoiaInputPlugin.cxx' input_plugins_sources += 'CdioParanoiaInputPlugin.cxx'
endif endif
...@@ -25,7 +25,7 @@ if ffmpeg_dep.found() ...@@ -25,7 +25,7 @@ if ffmpeg_dep.found()
endif endif
libmms_dep = dependency('libmms', version: '>= 0.4', required: get_option('mms')) libmms_dep = dependency('libmms', version: '>= 0.4', required: get_option('mms'))
conf.set('ENABLE_MMS', libmms_dep.found()) input_features.set('ENABLE_MMS', libmms_dep.found())
if libmms_dep.found() if libmms_dep.found()
input_plugins_sources += 'MmsInputPlugin.cxx' input_plugins_sources += 'MmsInputPlugin.cxx'
endif endif
...@@ -47,7 +47,7 @@ else ...@@ -47,7 +47,7 @@ else
error('Qobuz requires CURL, libyajl and libgcrypt') error('Qobuz requires CURL, libyajl and libgcrypt')
endif endif
endif endif
conf.set('ENABLE_QOBUZ', enable_qobuz) input_features.set('ENABLE_QOBUZ', enable_qobuz)
if enable_qobuz if enable_qobuz
input_plugins_sources += [ input_plugins_sources += [
'QobuzClient.cxx', 'QobuzClient.cxx',
...@@ -68,7 +68,7 @@ else ...@@ -68,7 +68,7 @@ else
error('Tidal requires CURL and libyajl') error('Tidal requires CURL and libyajl')
endif endif
endif endif
conf.set('ENABLE_TIDAL', enable_tidal) input_features.set('ENABLE_TIDAL', enable_tidal)
if enable_tidal if enable_tidal
input_plugins_sources += [ input_plugins_sources += [
'TidalErrorParser.cxx', 'TidalErrorParser.cxx',
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "tag/ReplayGain.hxx" #include "tag/ReplayGain.hxx"
#include "ReplayGainInfo.hxx" #include "ReplayGainInfo.hxx"
#include "util/StringView.hxx" #include "util/StringView.hxx"
#include "config.h" #include "decoder/Features.h"
#ifndef HAVE_TREMOR #ifndef HAVE_TREMOR
#include <vorbis/codec.h> #include <vorbis/codec.h>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include "mixer/MixerInternal.hxx" #include "mixer/MixerInternal.hxx"
#include "output/Features.h"
#include "output/OutputAPI.hxx" #include "output/OutputAPI.hxx"
#include "output/plugins/WinmmOutputPlugin.hxx" #include "output/plugins/WinmmOutputPlugin.hxx"
#include "util/Math.hxx" #include "util/Math.hxx"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "config.h" #include "config.h"
#include "Registry.hxx" #include "Registry.hxx"
#include "OutputPlugin.hxx" #include "OutputPlugin.hxx"
#include "output/Features.h"
#include "plugins/AlsaOutputPlugin.hxx" #include "plugins/AlsaOutputPlugin.hxx"
#include "plugins/AoOutputPlugin.hxx" #include "plugins/AoOutputPlugin.hxx"
#include "plugins/FifoOutputPlugin.hxx" #include "plugins/FifoOutputPlugin.hxx"
......
output_features = configuration_data()
output_api = static_library( output_api = static_library(
'output_api', 'output_api',
'Interface.cxx', 'Interface.cxx',
...@@ -44,3 +46,5 @@ output_glue_dep = declare_dependency( ...@@ -44,3 +46,5 @@ output_glue_dep = declare_dependency(
], ],
) )
configure_file(output: 'Features.h', configuration: output_features)
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "config.h" #include "config.h"
#include "JackOutputPlugin.hxx" #include "JackOutputPlugin.hxx"
#include "../OutputAPI.hxx" #include "../OutputAPI.hxx"
#include "output/Features.h"
#include "thread/Mutex.hxx" #include "thread/Mutex.hxx"
#include "util/ScopeExit.hxx" #include "util/ScopeExit.hxx"
#include "util/ConstBuffer.hxx" #include "util/ConstBuffer.hxx"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef MPD_WINMM_OUTPUT_PLUGIN_HXX #ifndef MPD_WINMM_OUTPUT_PLUGIN_HXX
#define MPD_WINMM_OUTPUT_PLUGIN_HXX #define MPD_WINMM_OUTPUT_PLUGIN_HXX
#include "config.h" #include "output/Features.h"
#ifdef ENABLE_WINMM_OUTPUT #ifdef ENABLE_WINMM_OUTPUT
......
...@@ -16,13 +16,13 @@ if alsa_dep.found() ...@@ -16,13 +16,13 @@ if alsa_dep.found()
endif endif
libao_dep = dependency('ao', required: get_option('ao')) libao_dep = dependency('ao', required: get_option('ao'))
conf.set('ENABLE_AO', libao_dep.found()) output_features.set('ENABLE_AO', libao_dep.found())
if libao_dep.found() if libao_dep.found()
output_plugins_sources += 'AoOutputPlugin.cxx' output_plugins_sources += 'AoOutputPlugin.cxx'
endif endif
enable_fifo_output = get_option('fifo') and not is_windows enable_fifo_output = get_option('fifo') and not is_windows
conf.set('HAVE_FIFO', enable_fifo_output) output_features.set('HAVE_FIFO', enable_fifo_output)
if enable_fifo_output if enable_fifo_output
output_plugins_sources += 'FifoOutputPlugin.cxx' output_plugins_sources += 'FifoOutputPlugin.cxx'
endif endif
...@@ -31,7 +31,7 @@ if is_haiku ...@@ -31,7 +31,7 @@ if is_haiku
output_plugins_sources += 'HaikuOutputPlugin.cxx' output_plugins_sources += 'HaikuOutputPlugin.cxx'
endif endif
conf.set('ENABLE_HTTPD_OUTPUT', get_option('httpd')) output_features.set('ENABLE_HTTPD_OUTPUT', get_option('httpd'))
if get_option('httpd') if get_option('httpd')
output_plugins_sources += [ output_plugins_sources += [
'httpd/IcyMetaDataServer.cxx', 'httpd/IcyMetaDataServer.cxx',
...@@ -44,10 +44,10 @@ if get_option('httpd') ...@@ -44,10 +44,10 @@ if get_option('httpd')
endif endif
libjack_dep = dependency('jack', version: '>= 0.100', required: get_option('jack')) libjack_dep = dependency('jack', version: '>= 0.100', required: get_option('jack'))
conf.set('ENABLE_JACK', libjack_dep.found()) output_features.set('ENABLE_JACK', libjack_dep.found())
if libjack_dep.found() if libjack_dep.found()
output_plugins_sources += 'JackOutputPlugin.cxx' output_plugins_sources += 'JackOutputPlugin.cxx'
conf.set('HAVE_JACK_SET_INFO_FUNCTION', compiler.has_header_symbol('jack/jack.h', 'jack_set_info_function')) output_features.set('HAVE_JACK_SET_INFO_FUNCTION', compiler.has_header_symbol('jack/jack.h', 'jack_set_info_function'))
endif endif
openal_dep = dependency('', required: false) openal_dep = dependency('', required: false)
...@@ -66,7 +66,7 @@ if not get_option('openal').disabled() ...@@ -66,7 +66,7 @@ if not get_option('openal').disabled()
error('OpenAL not available') error('OpenAL not available')
endif endif
endif endif
conf.set('HAVE_OPENAL', openal_dep.found()) output_features.set('HAVE_OPENAL', openal_dep.found())
if enable_oss if enable_oss
output_plugins_sources += 'OssOutputPlugin.cxx' output_plugins_sources += 'OssOutputPlugin.cxx'
...@@ -85,10 +85,10 @@ if is_darwin ...@@ -85,10 +85,10 @@ if is_darwin
else else
audiounit_dep = dependency('', required: false) audiounit_dep = dependency('', required: false)
endif endif
conf.set('HAVE_OSX', is_darwin) output_features.set('HAVE_OSX', is_darwin)
enable_pipe_output = get_option('pipe') and not is_windows enable_pipe_output = get_option('pipe') and not is_windows
conf.set('ENABLE_PIPE_OUTPUT', enable_pipe_output) output_features.set('ENABLE_PIPE_OUTPUT', enable_pipe_output)
if enable_pipe_output if enable_pipe_output
output_plugins_sources += 'PipeOutputPlugin.cxx' output_plugins_sources += 'PipeOutputPlugin.cxx'
endif endif
...@@ -97,14 +97,14 @@ if pulse_dep.found() ...@@ -97,14 +97,14 @@ if pulse_dep.found()
output_plugins_sources += 'PulseOutputPlugin.cxx' output_plugins_sources += 'PulseOutputPlugin.cxx'
endif endif
conf.set('ENABLE_RECORDER_OUTPUT', get_option('recorder')) output_features.set('ENABLE_RECORDER_OUTPUT', get_option('recorder'))
if get_option('recorder') if get_option('recorder')
output_plugins_sources += 'RecorderOutputPlugin.cxx' output_plugins_sources += 'RecorderOutputPlugin.cxx'
need_encoder = true need_encoder = true
endif endif
libshout_dep = dependency('shout', required: get_option('shout')) libshout_dep = dependency('shout', required: get_option('shout'))
conf.set('HAVE_SHOUT', libshout_dep.found()) output_features.set('HAVE_SHOUT', libshout_dep.found())
if libshout_dep.found() if libshout_dep.found()
output_plugins_sources += 'ShoutOutputPlugin.cxx' output_plugins_sources += 'ShoutOutputPlugin.cxx'
need_encoder = true need_encoder = true
...@@ -127,12 +127,12 @@ if enable_solaris_output.auto() ...@@ -127,12 +127,12 @@ if enable_solaris_output.auto()
else else
enable_solaris_output = enable_solaris_output.enabled() enable_solaris_output = enable_solaris_output.enabled()
endif endif
conf.set('ENABLE_SOLARIS_OUTPUT', enable_solaris_output) output_features.set('ENABLE_SOLARIS_OUTPUT', enable_solaris_output)
if enable_solaris_output if enable_solaris_output
output_plugins_sources += 'SolarisOutputPlugin.cxx' output_plugins_sources += 'SolarisOutputPlugin.cxx'
endif endif
conf.set('ENABLE_WINMM_OUTPUT', is_windows) output_features.set('ENABLE_WINMM_OUTPUT', is_windows)
if is_windows if is_windows
output_plugins_sources += 'WinmmOutputPlugin.cxx' output_plugins_sources += 'WinmmOutputPlugin.cxx'
winmm_dep = c_compiler.find_library('winmm') winmm_dep = c_compiler.find_library('winmm')
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "PlaylistRegistry.hxx" #include "PlaylistRegistry.hxx"
#include "PlaylistPlugin.hxx" #include "PlaylistPlugin.hxx"
#include "SongEnumerator.hxx" #include "SongEnumerator.hxx"
#include "playlist/Features.h"
#include "plugins/ExtM3uPlaylistPlugin.hxx" #include "plugins/ExtM3uPlaylistPlugin.hxx"
#include "plugins/M3uPlaylistPlugin.hxx" #include "plugins/M3uPlaylistPlugin.hxx"
#include "plugins/XspfPlaylistPlugin.hxx" #include "plugins/XspfPlaylistPlugin.hxx"
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
#include "plugins/FlacPlaylistPlugin.hxx" #include "plugins/FlacPlaylistPlugin.hxx"
#include "plugins/CuePlaylistPlugin.hxx" #include "plugins/CuePlaylistPlugin.hxx"
#include "plugins/EmbeddedCuePlaylistPlugin.hxx" #include "plugins/EmbeddedCuePlaylistPlugin.hxx"
#include "decoder/Features.h"
#include "input/InputStream.hxx" #include "input/InputStream.hxx"
#include "util/MimeType.hxx" #include "util/MimeType.hxx"
#include "util/StringView.hxx" #include "util/StringView.hxx"
......
playlist_features = configuration_data()
playlist_api = static_library( playlist_api = static_library(
'playlist_api', 'playlist_api',
'PlaylistPlugin.cxx', 'PlaylistPlugin.cxx',
...@@ -23,3 +25,5 @@ playlist_glue_dep = declare_dependency( ...@@ -23,3 +25,5 @@ playlist_glue_dep = declare_dependency(
playlist_plugins_dep, playlist_plugins_dep,
], ],
) )
configure_file(output: 'Features.h', configuration: playlist_features)
...@@ -9,7 +9,7 @@ playlist_plugins_deps = [ ...@@ -9,7 +9,7 @@ playlist_plugins_deps = [
flac_dep, flac_dep,
] ]
conf.set('ENABLE_CUE', get_option('cue')) playlist_features.set('ENABLE_CUE', get_option('cue'))
if get_option('cue') if get_option('cue')
playlist_plugins_sources += [ playlist_plugins_sources += [
'../cue/CueParser.cxx', '../cue/CueParser.cxx',
...@@ -39,7 +39,7 @@ else ...@@ -39,7 +39,7 @@ else
error('SoundCloud requires CURL and libyajl') error('SoundCloud requires CURL and libyajl')
endif endif
endif endif
conf.set('ENABLE_SOUNDCLOUD', enable_soundcloud) playlist_features.set('ENABLE_SOUNDCLOUD', enable_soundcloud)
if enable_soundcloud if enable_soundcloud
playlist_plugins_sources += 'SoundCloudPlaylistPlugin.cxx' playlist_plugins_sources += 'SoundCloudPlaylistPlugin.cxx'
playlist_plugins_deps += yajl_dep playlist_plugins_deps += yajl_dep
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment