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

This makes ccache more efficient when recompiling with different
plugins.
This commit is contained in:
Max Kellermann
2020-05-05 14:45:18 +02:00
parent 8c1d78873d
commit 8f178401e4
25 changed files with 86 additions and 52 deletions

View File

@@ -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>

View File

@@ -1,4 +1,6 @@
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)

View File

@@ -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