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 @@
#include "neighbor/NeighborPlugin.hxx"
#endif
#include "encoder/Features.h"
#ifdef ENABLE_ENCODER
#include "encoder/EncoderList.hxx"
#include "encoder/EncoderPlugin.hxx"
......
......@@ -17,9 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ArchiveList.hxx"
#include "ArchivePlugin.hxx"
#include "archive/Features.h"
#include "util/StringUtil.hxx"
#include "plugins/Bzip2ArchivePlugin.hxx"
#include "plugins/Iso9660ArchivePlugin.hxx"
......
archive_features = configuration_data()
archive_api = static_library(
'archive_api',
'ArchiveList.cxx',
......@@ -10,6 +12,8 @@ archive_api_dep = declare_dependency(
subdir('plugins')
configure_file(output: 'Features.h', configuration: archive_features)
conf.set('ENABLE_ARCHIVE', found_archive_plugin)
if not found_archive_plugin
archive_glue_dep = dependency('', required: false)
......
......@@ -2,21 +2,21 @@ archive_plugins_sources = []
found_archive_plugin = false
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()
archive_plugins_sources += 'Iso9660ArchivePlugin.cxx'
found_archive_plugin = true
endif
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()
archive_plugins_sources += 'Bzip2ArchivePlugin.cxx'
found_archive_plugin = true
endif
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()
archive_plugins_sources += 'ZzipArchivePlugin.cxx'
found_archive_plugin = true
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include "DecoderList.hxx"
#include "DecoderPlugin.hxx"
#include "decoder/Features.h"
#include "PluginUnavailable.hxx"
#include "Log.hxx"
#include "config/Data.hxx"
......
decoder_features = configuration_data()
decoder_api = static_library(
'decoder_api',
'DecoderAPI.cxx',
......@@ -34,3 +36,5 @@ decoder_glue_dep = declare_dependency(
decoder_plugins_dep,
],
)
configure_file(output: 'Features.h', configuration: decoder_features)
......@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "SidplayDecoderPlugin.hxx"
#include "decoder/Features.h"
#include "../DecoderAPI.hxx"
#include "tag/Handler.hxx"
#include "tag/Builder.hxx"
......
......@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "VorbisDecoderPlugin.h"
#include "OggDecoder.hxx"
#include "lib/xiph/VorbisComments.hxx"
......@@ -25,6 +24,7 @@
#include "lib/xiph/OggFind.hxx"
#include "VorbisDomain.hxx"
#include "../DecoderAPI.hxx"
#include "decoder/Features.h"
#include "input/InputStream.hxx"
#include "input/Reader.hxx"
#include "OggCodec.hxx"
......
......@@ -20,12 +20,12 @@ if ffmpeg_dep.found()
endif
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()
decoder_plugins_sources += 'AdPlugDecoderPlugin.cxx'
endif
conf.set('ENABLE_FLAC', flac_dep.found())
decoder_features.set('ENABLE_FLAC', flac_dep.found())
if flac_dep.found()
decoder_plugins_sources += [
'FlacDecoderPlugin.cxx',
......@@ -36,8 +36,8 @@ if flac_dep.found()
]
endif
conf.set('ENABLE_VORBIS_DECODER', vorbis_dep.found())
conf.set('HAVE_TREMOR', libvorbisidec_dep.found())
decoder_features.set('ENABLE_VORBIS_DECODER', vorbis_dep.found())
decoder_features.set('HAVE_TREMOR', libvorbisidec_dep.found())
if vorbis_dep.found()
decoder_plugins_sources += [
'VorbisDecoderPlugin.cxx',
......@@ -45,7 +45,7 @@ if vorbis_dep.found()
]
endif
conf.set('ENABLE_OPUS', libopus_dep.found())
decoder_features.set('ENABLE_OPUS', libopus_dep.found())
if libopus_dep.found()
decoder_plugins_sources += [
'OpusDecoderPlugin.cxx',
......@@ -64,80 +64,80 @@ if xiph_dep.found()
endif
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()
decoder_plugins_sources += 'FluidsynthDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'AudiofileDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'FaadDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'GmeDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'MadDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'MikmodDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'ModplugDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'MpcdecDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'Mpg123DecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'SndfileDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'WavpackDecoderPlugin.cxx'
endif
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()
decoder_plugins_sources += 'WildmidiDecoderPlugin.cxx'
endif
if not get_option('sidplay').disabled()
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()
libsidplay_dep = libsidplayfp_dep
......@@ -156,7 +156,7 @@ if not get_option('sidplay').disabled()
else
libsidplay_dep = dependency('', required: false)
endif
conf.set('ENABLE_SIDPLAY', libsidplay_dep.found())
decoder_features.set('ENABLE_SIDPLAY', libsidplay_dep.found())
if libsidplay_dep.found()
decoder_plugins_sources += 'SidplayDecoderPlugin.cxx'
endif
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include "EncoderList.hxx"
#include "EncoderPlugin.hxx"
#include "encoder/Features.h"
#include "plugins/NullEncoderPlugin.hxx"
#include "plugins/WaveEncoderPlugin.hxx"
#include "plugins/VorbisEncoderPlugin.hxx"
......@@ -28,6 +29,7 @@
#include "plugins/ShineEncoderPlugin.hxx"
#include "plugins/LameEncoderPlugin.hxx"
#include "plugins/TwolameEncoderPlugin.hxx"
#include "decoder/Features.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
encoder_glue_dep = dependency('', required: false)
......@@ -23,3 +25,5 @@ encoder_glue_dep = declare_dependency(
encoder_plugins_dep,
],
)
configure_file(output: 'Features.h', configuration: encoder_features)
......@@ -2,7 +2,7 @@ encoder_plugins_sources = [
'NullEncoderPlugin.cxx',
]
conf.set('ENABLE_FLAC_ENCODER', flac_dep.found())
encoder_features.set('ENABLE_FLAC_ENCODER', flac_dep.found())
if flac_dep.found()
encoder_plugins_sources += 'FlacEncoderPlugin.cxx'
endif
......@@ -11,30 +11,30 @@ if libopus_dep.found()
encoder_plugins_sources += 'OpusEncoderPlugin.cxx'
endif
conf.set('ENABLE_VORBISENC', libvorbisenc_dep.found())
encoder_features.set('ENABLE_VORBISENC', libvorbisenc_dep.found())
if libvorbisenc_dep.found()
encoder_plugins_sources += 'VorbisEncoderPlugin.cxx'
endif
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()
encoder_plugins_sources += 'LameEncoderPlugin.cxx'
endif
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()
encoder_plugins_sources += 'TwolameEncoderPlugin.cxx'
endif
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()
encoder_plugins_sources += 'ShineEncoderPlugin.cxx'
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')
encoder_plugins_sources += 'WaveEncoderPlugin.cxx'
endif
......
......@@ -19,6 +19,7 @@
#include "Registry.hxx"
#include "InputPlugin.hxx"
#include "input/Features.h"
#include "plugins/TidalInputPlugin.hxx"
#include "plugins/QobuzInputPlugin.hxx"
#include "config.h"
......
input_features = configuration_data()
input_api = static_library(
'input_api',
'Error.cxx',
......@@ -54,3 +56,5 @@ input_glue_dep = declare_dependency(
tag_dep,
],
)
configure_file(output: 'Features.h', configuration: input_features)
......@@ -7,7 +7,7 @@ if alsa_dep.found()
endif
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()
input_plugins_sources += 'CdioParanoiaInputPlugin.cxx'
endif
......@@ -25,7 +25,7 @@ if ffmpeg_dep.found()
endif
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()
input_plugins_sources += 'MmsInputPlugin.cxx'
endif
......@@ -47,7 +47,7 @@ else
error('Qobuz requires CURL, libyajl and libgcrypt')
endif
endif
conf.set('ENABLE_QOBUZ', enable_qobuz)
input_features.set('ENABLE_QOBUZ', enable_qobuz)
if enable_qobuz
input_plugins_sources += [
'QobuzClient.cxx',
......@@ -68,7 +68,7 @@ else
error('Tidal requires CURL and libyajl')
endif
endif
conf.set('ENABLE_TIDAL', enable_tidal)
input_features.set('ENABLE_TIDAL', enable_tidal)
if enable_tidal
input_plugins_sources += [
'TidalErrorParser.cxx',
......
......@@ -27,7 +27,7 @@
#include "tag/ReplayGain.hxx"
#include "ReplayGainInfo.hxx"
#include "util/StringView.hxx"
#include "config.h"
#include "decoder/Features.h"
#ifndef HAVE_TREMOR
#include <vorbis/codec.h>
......
......@@ -18,6 +18,7 @@
*/
#include "mixer/MixerInternal.hxx"
#include "output/Features.h"
#include "output/OutputAPI.hxx"
#include "output/plugins/WinmmOutputPlugin.hxx"
#include "util/Math.hxx"
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include "Registry.hxx"
#include "OutputPlugin.hxx"
#include "output/Features.h"
#include "plugins/AlsaOutputPlugin.hxx"
#include "plugins/AoOutputPlugin.hxx"
#include "plugins/FifoOutputPlugin.hxx"
......
output_features = configuration_data()
output_api = static_library(
'output_api',
'Interface.cxx',
......@@ -44,3 +46,5 @@ output_glue_dep = declare_dependency(
],
)
configure_file(output: 'Features.h', configuration: output_features)
......@@ -20,6 +20,7 @@
#include "config.h"
#include "JackOutputPlugin.hxx"
#include "../OutputAPI.hxx"
#include "output/Features.h"
#include "thread/Mutex.hxx"
#include "util/ScopeExit.hxx"
#include "util/ConstBuffer.hxx"
......
......@@ -20,7 +20,7 @@
#ifndef MPD_WINMM_OUTPUT_PLUGIN_HXX
#define MPD_WINMM_OUTPUT_PLUGIN_HXX
#include "config.h"
#include "output/Features.h"
#ifdef ENABLE_WINMM_OUTPUT
......
......@@ -16,13 +16,13 @@ if alsa_dep.found()
endif
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()
output_plugins_sources += 'AoOutputPlugin.cxx'
endif
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
output_plugins_sources += 'FifoOutputPlugin.cxx'
endif
......@@ -31,7 +31,7 @@ if is_haiku
output_plugins_sources += 'HaikuOutputPlugin.cxx'
endif
conf.set('ENABLE_HTTPD_OUTPUT', get_option('httpd'))
output_features.set('ENABLE_HTTPD_OUTPUT', get_option('httpd'))
if get_option('httpd')
output_plugins_sources += [
'httpd/IcyMetaDataServer.cxx',
......@@ -44,10 +44,10 @@ if get_option('httpd')
endif
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()
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
openal_dep = dependency('', required: false)
......@@ -66,7 +66,7 @@ if not get_option('openal').disabled()
error('OpenAL not available')
endif
endif
conf.set('HAVE_OPENAL', openal_dep.found())
output_features.set('HAVE_OPENAL', openal_dep.found())
if enable_oss
output_plugins_sources += 'OssOutputPlugin.cxx'
......@@ -85,10 +85,10 @@ if is_darwin
else
audiounit_dep = dependency('', required: false)
endif
conf.set('HAVE_OSX', is_darwin)
output_features.set('HAVE_OSX', is_darwin)
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
output_plugins_sources += 'PipeOutputPlugin.cxx'
endif
......@@ -97,14 +97,14 @@ if pulse_dep.found()
output_plugins_sources += 'PulseOutputPlugin.cxx'
endif
conf.set('ENABLE_RECORDER_OUTPUT', get_option('recorder'))
output_features.set('ENABLE_RECORDER_OUTPUT', get_option('recorder'))
if get_option('recorder')
output_plugins_sources += 'RecorderOutputPlugin.cxx'
need_encoder = true
endif
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()
output_plugins_sources += 'ShoutOutputPlugin.cxx'
need_encoder = true
......@@ -127,12 +127,12 @@ if enable_solaris_output.auto()
else
enable_solaris_output = enable_solaris_output.enabled()
endif
conf.set('ENABLE_SOLARIS_OUTPUT', enable_solaris_output)
output_features.set('ENABLE_SOLARIS_OUTPUT', enable_solaris_output)
if enable_solaris_output
output_plugins_sources += 'SolarisOutputPlugin.cxx'
endif
conf.set('ENABLE_WINMM_OUTPUT', is_windows)
output_features.set('ENABLE_WINMM_OUTPUT', is_windows)
if is_windows
output_plugins_sources += 'WinmmOutputPlugin.cxx'
winmm_dep = c_compiler.find_library('winmm')
......
......@@ -21,6 +21,7 @@
#include "PlaylistRegistry.hxx"
#include "PlaylistPlugin.hxx"
#include "SongEnumerator.hxx"
#include "playlist/Features.h"
#include "plugins/ExtM3uPlaylistPlugin.hxx"
#include "plugins/M3uPlaylistPlugin.hxx"
#include "plugins/XspfPlaylistPlugin.hxx"
......@@ -31,6 +32,7 @@
#include "plugins/FlacPlaylistPlugin.hxx"
#include "plugins/CuePlaylistPlugin.hxx"
#include "plugins/EmbeddedCuePlaylistPlugin.hxx"
#include "decoder/Features.h"
#include "input/InputStream.hxx"
#include "util/MimeType.hxx"
#include "util/StringView.hxx"
......
playlist_features = configuration_data()
playlist_api = static_library(
'playlist_api',
'PlaylistPlugin.cxx',
......@@ -23,3 +25,5 @@ playlist_glue_dep = declare_dependency(
playlist_plugins_dep,
],
)
configure_file(output: 'Features.h', configuration: playlist_features)
......@@ -9,7 +9,7 @@ playlist_plugins_deps = [
flac_dep,
]
conf.set('ENABLE_CUE', get_option('cue'))
playlist_features.set('ENABLE_CUE', get_option('cue'))
if get_option('cue')
playlist_plugins_sources += [
'../cue/CueParser.cxx',
......@@ -39,7 +39,7 @@ else
error('SoundCloud requires CURL and libyajl')
endif
endif
conf.set('ENABLE_SOUNDCLOUD', enable_soundcloud)
playlist_features.set('ENABLE_SOUNDCLOUD', enable_soundcloud)
if enable_soundcloud
playlist_plugins_sources += 'SoundCloudPlaylistPlugin.cxx'
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