pcm/meson.build: split libpcm into two

One basic library without dependencies, and one with heavy
dependencies like libsamplerate.
This commit is contained in:
Max Kellermann 2020-01-18 20:07:55 +01:00
parent 7551867249
commit 914ad261ed
4 changed files with 30 additions and 14 deletions

View File

@ -7,6 +7,7 @@ decoder_api = static_library(
include_directories: inc,
dependencies: [
log_dep,
pcm_basic_dep,
],
)

View File

@ -44,6 +44,7 @@ encoder_plugins = static_library(
encoder_plugins_sources,
include_directories: inc,
dependencies: [
pcm_basic_dep,
flac_dep,
ogg_dep,
libopus_dep,

View File

@ -1,4 +1,4 @@
pcm_sources = [
pcm_basic_sources = [
'../CheckAudioFormat.cxx',
'../AudioFormat.cxx',
'../AudioParser.cxx',
@ -6,25 +6,17 @@ pcm_sources = [
'Interleave.cxx',
'Buffer.cxx',
'Export.cxx',
'Convert.cxx',
'Dop.cxx',
'Volume.cxx',
'Silence.cxx',
'Mix.cxx',
'PcmChannels.cxx',
'Pack.cxx',
'PcmFormat.cxx',
'FormatConverter.cxx',
'ChannelsConverter.cxx',
'Order.cxx',
'GlueResampler.cxx',
'FallbackResampler.cxx',
'ConfiguredResampler.cxx',
'Dither.cxx',
]
if get_option('dsd')
pcm_sources += [
pcm_basic_sources += [
'Dsd16.cxx',
'Dsd32.cxx',
'PcmDsd.cxx',
@ -32,6 +24,30 @@ if get_option('dsd')
]
endif
pcm_basic = static_library(
'pcm_basic',
pcm_basic_sources,
include_directories: inc,
dependencies: [
util_dep,
],
)
pcm_basic_dep = declare_dependency(
link_with: pcm_basic,
)
pcm_sources = [
'Convert.cxx',
'PcmChannels.cxx',
'PcmFormat.cxx',
'FormatConverter.cxx',
'ChannelsConverter.cxx',
'GlueResampler.cxx',
'FallbackResampler.cxx',
'ConfiguredResampler.cxx',
]
libsamplerate_dep = dependency('samplerate', version: '>= 0.1.3', required: get_option('libsamplerate'))
if libsamplerate_dep.found()
conf.set('ENABLE_LIBSAMPLERATE', true)
@ -50,6 +66,7 @@ pcm = static_library(
include_directories: inc,
dependencies: [
util_dep,
pcm_basic_dep,
libsamplerate_dep,
soxr_dep,
],

View File

@ -271,13 +271,11 @@ if enable_database
'../src/db/Selection.cxx',
'../src/db/PlaylistVector.cxx',
'../src/db/DatabaseLock.cxx',
'../src/AudioFormat.cxx',
'../src/AudioParser.cxx',
'../src/pcm/SampleFormat.cxx',
'../src/SongSave.cxx',
'../src/TagSave.cxx',
include_directories: inc,
dependencies: [
pcm_basic_dep,
song_dep,
fs_dep,
event_dep,
@ -540,7 +538,6 @@ if encoder_glue_dep.found()
executable(
'run_encoder',
'run_encoder.cxx',
'../src/AudioParser.cxx',
include_directories: inc,
dependencies: [
encoder_glue_dep,