From 914ad261edd4bf50b5c58edf76d744d3a36bd70e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 18 Jan 2020 20:07:55 +0100 Subject: [PATCH] pcm/meson.build: split libpcm into two One basic library without dependencies, and one with heavy dependencies like libsamplerate. --- src/decoder/meson.build | 1 + src/encoder/plugins/meson.build | 1 + src/pcm/meson.build | 37 ++++++++++++++++++++++++--------- test/meson.build | 5 +---- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/decoder/meson.build b/src/decoder/meson.build index 072240cd0..4b86a2fcf 100644 --- a/src/decoder/meson.build +++ b/src/decoder/meson.build @@ -7,6 +7,7 @@ decoder_api = static_library( include_directories: inc, dependencies: [ log_dep, + pcm_basic_dep, ], ) diff --git a/src/encoder/plugins/meson.build b/src/encoder/plugins/meson.build index 19ecb587c..f0c6863cd 100644 --- a/src/encoder/plugins/meson.build +++ b/src/encoder/plugins/meson.build @@ -44,6 +44,7 @@ encoder_plugins = static_library( encoder_plugins_sources, include_directories: inc, dependencies: [ + pcm_basic_dep, flac_dep, ogg_dep, libopus_dep, diff --git a/src/pcm/meson.build b/src/pcm/meson.build index 0ee8b6766..7cdb2f83a 100644 --- a/src/pcm/meson.build +++ b/src/pcm/meson.build @@ -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, ], diff --git a/test/meson.build b/test/meson.build index a13d7ca4a..7fcf4c822 100644 --- a/test/meson.build +++ b/test/meson.build @@ -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,