meson.build 1.69 KB
Newer Older
1 2 3 4
encoder_plugins_sources = [
  'NullEncoderPlugin.cxx',
]

5
encoder_features.set('ENABLE_FLAC_ENCODER', flac_dep.found())
6 7 8 9 10 11 12 13
if flac_dep.found()
  encoder_plugins_sources += 'FlacEncoderPlugin.cxx'
endif

if libopus_dep.found()
  encoder_plugins_sources += 'OpusEncoderPlugin.cxx'
endif

14
encoder_features.set('ENABLE_VORBISENC', libvorbisenc_dep.found())
15 16 17 18 19
if libvorbisenc_dep.found()
  encoder_plugins_sources += 'VorbisEncoderPlugin.cxx'
endif

liblame_dep = c_compiler.find_library('mp3lame', required: get_option('lame'))
20
encoder_features.set('ENABLE_LAME', liblame_dep.found())
21 22 23 24 25
if liblame_dep.found()
  encoder_plugins_sources += 'LameEncoderPlugin.cxx'
endif

libtwolame_dep = dependency('twolame', required: get_option('twolame'))
26
encoder_features.set('ENABLE_TWOLAME', libtwolame_dep.found())
27 28 29 30 31
if libtwolame_dep.found()
  encoder_plugins_sources += 'TwolameEncoderPlugin.cxx'
endif

libshine_dep = dependency('shine', version: '>= 3.1', required: get_option('shine'))
32
encoder_features.set('ENABLE_SHINE', libshine_dep.found())
33 34 35 36
if libshine_dep.found()
  encoder_plugins_sources += 'ShineEncoderPlugin.cxx'
endif

37
encoder_features.set('ENABLE_WAVE_ENCODER', get_option('wave_encoder'))
38 39 40 41 42 43 44 45 46
if get_option('wave_encoder')
  encoder_plugins_sources += 'WaveEncoderPlugin.cxx'
endif

encoder_plugins = static_library(
  'encoder_plugins',
  encoder_plugins_sources,
  include_directories: inc,
  dependencies: [
47
    pcm_basic_dep,
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
    flac_dep,
    ogg_dep,
    libopus_dep,
    libvorbisenc_dep,
    libvorbis_dep,
    liblame_dep,
    libtwolame_dep,
    libshine_dep,
  ],
)

encoder_plugins_dep = declare_dependency(
  link_with: encoder_plugins,
  dependencies: [
    encoder_api_dep,
    tag_dep,
    pcm_dep,
    config_dep,
  ],
)