Commit 75518672 authored by Max Kellermann's avatar Max Kellermann

meson.build: move Log.cxx and LogBackend.cxx into a static library

Prevents compiling those sources many times, once for each debug program using it.
parent bdd31674
...@@ -190,6 +190,17 @@ if boost_dep.version() == '1.67' ...@@ -190,6 +190,17 @@ if boost_dep.version() == '1.67'
warning('Your Boost version 1.67 is known to be buggy, and the MPD build will fail. Please upgrade to Boost 1.68 or later.') warning('Your Boost version 1.67 is known to be buggy, and the MPD build will fail. Please upgrade to Boost 1.68 or later.')
endif endif
log = static_library(
'log',
'src/Log.cxx',
'src/LogBackend.cxx',
include_directories: inc,
)
log_dep = declare_dependency(
link_with: log,
)
sources = [ sources = [
version_cxx, version_cxx,
'src/Main.cxx', 'src/Main.cxx',
...@@ -235,8 +246,6 @@ sources = [ ...@@ -235,8 +246,6 @@ sources = [
'src/client/ThreadBackgroundCommand.cxx', 'src/client/ThreadBackgroundCommand.cxx',
'src/Listen.cxx', 'src/Listen.cxx',
'src/LogInit.cxx', 'src/LogInit.cxx',
'src/LogBackend.cxx',
'src/Log.cxx',
'src/ls.cxx', 'src/ls.cxx',
'src/Instance.cxx', 'src/Instance.cxx',
'src/win32/Win32Main.cxx', 'src/win32/Win32Main.cxx',
......
...@@ -12,6 +12,9 @@ config = static_library( ...@@ -12,6 +12,9 @@ config = static_library(
'Domain.cxx', 'Domain.cxx',
'Net.cxx', 'Net.cxx',
include_directories: inc, include_directories: inc,
dependencies: [
log_dep,
],
) )
config_dep = declare_dependency( config_dep = declare_dependency(
......
...@@ -54,6 +54,7 @@ db_glue = static_library( ...@@ -54,6 +54,7 @@ db_glue = static_library(
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
boost_dep, boost_dep,
log_dep,
], ],
) )
......
...@@ -5,6 +5,9 @@ decoder_api = static_library( ...@@ -5,6 +5,9 @@ decoder_api = static_library(
'DecoderBuffer.cxx', 'DecoderBuffer.cxx',
'DecoderPlugin.cxx', 'DecoderPlugin.cxx',
include_directories: inc, include_directories: inc,
dependencies: [
log_dep,
],
) )
decoder_api_dep = declare_dependency( decoder_api_dep = declare_dependency(
......
...@@ -18,6 +18,7 @@ event = static_library( ...@@ -18,6 +18,7 @@ event = static_library(
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
boost_dep, boost_dep,
log_dep,
], ],
) )
......
...@@ -40,6 +40,7 @@ fs = static_library( ...@@ -40,6 +40,7 @@ fs = static_library(
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
zlib_dep, zlib_dep,
log_dep,
], ],
) )
......
...@@ -85,6 +85,7 @@ input_plugins = static_library( ...@@ -85,6 +85,7 @@ input_plugins = static_library(
input_plugins_sources, input_plugins_sources,
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
log_dep,
alsa_dep, alsa_dep,
curl_dep, curl_dep,
ffmpeg_dep, ffmpeg_dep,
......
...@@ -15,6 +15,7 @@ curl = static_library( ...@@ -15,6 +15,7 @@ curl = static_library(
'Form.cxx', 'Form.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
log_dep,
curl_dep, curl_dep,
], ],
) )
......
...@@ -6,6 +6,7 @@ output_plugins_deps = [ ...@@ -6,6 +6,7 @@ output_plugins_deps = [
output_api_dep, output_api_dep,
config_dep, config_dep,
tag_dep, tag_dep,
log_dep,
] ]
need_encoder = false need_encoder = false
......
...@@ -49,6 +49,7 @@ if zeroconf_option == 'bonjour' ...@@ -49,6 +49,7 @@ if zeroconf_option == 'bonjour'
link_with: zeroconf, link_with: zeroconf,
dependencies: [ dependencies: [
bonjour_dep, bonjour_dep,
log_dep,
], ],
) )
else else
...@@ -68,6 +69,7 @@ else ...@@ -68,6 +69,7 @@ else
libavahi_client_dep, libavahi_client_dep,
dbus_dep, dbus_dep,
time_dep, time_dep,
log_dep,
], ],
) )
......
...@@ -23,8 +23,6 @@ subdir('net') ...@@ -23,8 +23,6 @@ subdir('net')
executable( executable(
'read_conf', 'read_conf',
'read_conf.cxx', 'read_conf.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
config_dep, config_dep,
...@@ -65,8 +63,6 @@ test( ...@@ -65,8 +63,6 @@ test(
test('TestRewindInputStream', executable( test('TestRewindInputStream', executable(
'TestRewindInputStream', 'TestRewindInputStream',
'TestRewindInputStream.cxx', 'TestRewindInputStream.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
input_glue_dep, input_glue_dep,
...@@ -77,10 +73,9 @@ test('TestRewindInputStream', executable( ...@@ -77,10 +73,9 @@ test('TestRewindInputStream', executable(
test('test_mixramp', executable( test('test_mixramp', executable(
'test_mixramp', 'test_mixramp',
'test_mixramp.cxx', 'test_mixramp.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
log_dep,
util_dep, util_dep,
gtest_dep, gtest_dep,
], ],
...@@ -111,8 +106,6 @@ test('TestFs', executable( ...@@ -111,8 +106,6 @@ test('TestFs', executable(
'TestFs', 'TestFs',
'TestFs.cxx', 'TestFs.cxx',
'TestLookupFile.cxx', 'TestLookupFile.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
fs_dep, fs_dep,
...@@ -136,8 +129,6 @@ if libavahi_client_dep.found() ...@@ -136,8 +129,6 @@ if libavahi_client_dep.found()
'run_avahi', 'run_avahi',
'run_avahi.cxx', 'run_avahi.cxx',
'ShutdownHandler.cxx', 'ShutdownHandler.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
zeroconf_dep, zeroconf_dep,
...@@ -153,8 +144,6 @@ if enable_inotify ...@@ -153,8 +144,6 @@ if enable_inotify
'ShutdownHandler.cxx', 'ShutdownHandler.cxx',
'../src/db/update/InotifyDomain.cxx', '../src/db/update/InotifyDomain.cxx',
'../src/db/update/InotifySource.cxx', '../src/db/update/InotifySource.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
event_dep, event_dep,
...@@ -180,8 +169,6 @@ executable( ...@@ -180,8 +169,6 @@ executable(
executable( executable(
'WriteFile', 'WriteFile',
'WriteFile.cxx', 'WriteFile.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
fs_dep, fs_dep,
...@@ -191,8 +178,6 @@ executable( ...@@ -191,8 +178,6 @@ executable(
executable( executable(
'dump_text_file', 'dump_text_file',
'dump_text_file.cxx', 'dump_text_file.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
input_glue_dep, input_glue_dep,
...@@ -213,8 +198,6 @@ if zlib_dep.found() ...@@ -213,8 +198,6 @@ if zlib_dep.found()
executable( executable(
'run_gunzip', 'run_gunzip',
'run_gunzip.cxx', 'run_gunzip.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
fs_dep, fs_dep,
...@@ -258,8 +241,6 @@ if neighbor_glue_dep.found() ...@@ -258,8 +241,6 @@ if neighbor_glue_dep.found()
'run_neighbor_explorer', 'run_neighbor_explorer',
'run_neighbor_explorer.cxx', 'run_neighbor_explorer.cxx',
'ShutdownHandler.cxx', 'ShutdownHandler.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
neighbor_glue_dep, neighbor_glue_dep,
...@@ -275,8 +256,6 @@ if enable_database ...@@ -275,8 +256,6 @@ if enable_database
executable( executable(
'run_storage', 'run_storage',
'run_storage.cxx', 'run_storage.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
event_dep, event_dep,
...@@ -288,8 +267,6 @@ if enable_database ...@@ -288,8 +267,6 @@ if enable_database
'DumpDatabase', 'DumpDatabase',
'DumpDatabase.cxx', 'DumpDatabase.cxx',
'../src/protocol/Ack.cxx', '../src/protocol/Ack.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
'../src/db/Registry.cxx', '../src/db/Registry.cxx',
'../src/db/Selection.cxx', '../src/db/Selection.cxx',
'../src/db/PlaylistVector.cxx', '../src/db/PlaylistVector.cxx',
...@@ -314,7 +291,6 @@ if enable_database ...@@ -314,7 +291,6 @@ if enable_database
'../src/playlist/PlaylistSong.cxx', '../src/playlist/PlaylistSong.cxx',
'../src/SongLoader.cxx', '../src/SongLoader.cxx',
'../src/LocateUri.cxx', '../src/LocateUri.cxx',
'../src/Log.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
tag_dep, tag_dep,
...@@ -332,8 +308,6 @@ executable( ...@@ -332,8 +308,6 @@ executable(
'run_input', 'run_input',
'run_input.cxx', 'run_input.cxx',
'../src/TagSave.cxx', '../src/TagSave.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
input_glue_dep, input_glue_dep,
...@@ -346,8 +320,6 @@ if curl_dep.found() ...@@ -346,8 +320,6 @@ if curl_dep.found()
'RunCurl', 'RunCurl',
'RunCurl.cxx', 'RunCurl.cxx',
'ShutdownHandler.cxx', 'ShutdownHandler.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
curl_dep, curl_dep,
...@@ -357,8 +329,6 @@ if curl_dep.found() ...@@ -357,8 +329,6 @@ if curl_dep.found()
test('test_icy_parser', executable( test('test_icy_parser', executable(
'test_icy_parser', 'test_icy_parser',
'test_icy_parser.cxx', 'test_icy_parser.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
icu_dep, icu_dep,
...@@ -376,8 +346,6 @@ if archive_glue_dep.found() ...@@ -376,8 +346,6 @@ if archive_glue_dep.found()
executable( executable(
'visit_archive', 'visit_archive',
'visit_archive.cxx', 'visit_archive.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
archive_glue_dep, archive_glue_dep,
...@@ -412,8 +380,6 @@ executable( ...@@ -412,8 +380,6 @@ executable(
'dump_playlist.cxx', 'dump_playlist.cxx',
'../src/TagSave.cxx', '../src/TagSave.cxx',
'../src/TagFile.cxx', '../src/TagFile.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
playlist_glue_dep, playlist_glue_dep,
...@@ -432,8 +398,6 @@ if chromaprint_dep.found() ...@@ -432,8 +398,6 @@ if chromaprint_dep.found()
'RunChromaprint', 'RunChromaprint',
'RunChromaprint.cxx', 'RunChromaprint.cxx',
'../src/lib/chromaprint/DecoderClient.cxx', '../src/lib/chromaprint/DecoderClient.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
decoder_glue_dep, decoder_glue_dep,
...@@ -452,8 +416,6 @@ executable( ...@@ -452,8 +416,6 @@ executable(
'run_decoder', 'run_decoder',
'run_decoder.cxx', 'run_decoder.cxx',
'DumpDecoderClient.cxx', 'DumpDecoderClient.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
decoder_glue_dep, decoder_glue_dep,
...@@ -465,8 +427,6 @@ executable( ...@@ -465,8 +427,6 @@ executable(
executable( executable(
'read_tags', 'read_tags',
'read_tags.cxx', 'read_tags.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
decoder_glue_dep, decoder_glue_dep,
...@@ -480,8 +440,6 @@ executable( ...@@ -480,8 +440,6 @@ executable(
'ContainerScan.cxx', 'ContainerScan.cxx',
'../src/SongSave.cxx', '../src/SongSave.cxx',
'../src/TagSave.cxx', '../src/TagSave.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
decoder_glue_dep, decoder_glue_dep,
...@@ -493,8 +451,6 @@ executable( ...@@ -493,8 +451,6 @@ executable(
executable( executable(
'ReadApeTags', 'ReadApeTags',
'ReadApeTags.cxx', 'ReadApeTags.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
tag_dep, tag_dep,
...@@ -507,8 +463,6 @@ if libid3tag_dep.found() ...@@ -507,8 +463,6 @@ if libid3tag_dep.found()
executable( executable(
'dump_rva2', 'dump_rva2',
'dump_rva2.cxx', 'dump_rva2.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
tag_dep, tag_dep,
...@@ -543,8 +497,6 @@ test('test_pcm', executable( ...@@ -543,8 +497,6 @@ test('test_pcm', executable(
executable( executable(
'run_filter', 'run_filter',
'run_filter.cxx', 'run_filter.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
filter_glue_dep, filter_glue_dep,
...@@ -573,8 +525,6 @@ executable( ...@@ -573,8 +525,6 @@ executable(
executable( executable(
'run_convert', 'run_convert',
'run_convert.cxx', 'run_convert.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
pcm_dep, pcm_dep,
...@@ -591,8 +541,6 @@ if encoder_glue_dep.found() ...@@ -591,8 +541,6 @@ if encoder_glue_dep.found()
'run_encoder', 'run_encoder',
'run_encoder.cxx', 'run_encoder.cxx',
'../src/AudioParser.cxx', '../src/AudioParser.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
encoder_glue_dep, encoder_glue_dep,
...@@ -602,8 +550,6 @@ if encoder_glue_dep.found() ...@@ -602,8 +550,6 @@ if encoder_glue_dep.found()
executable( executable(
'test_vorbis_encoder', 'test_vorbis_encoder',
'test_vorbis_encoder.cxx', 'test_vorbis_encoder.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
encoder_glue_dep, encoder_glue_dep,
...@@ -618,8 +564,6 @@ endif ...@@ -618,8 +564,6 @@ endif
executable( executable(
'run_output', 'run_output',
'run_output.cxx', 'run_output.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
output_glue_dep, output_glue_dep,
...@@ -637,8 +581,6 @@ if alsa_dep.found() ...@@ -637,8 +581,6 @@ if alsa_dep.found()
executable( executable(
'read_mixer', 'read_mixer',
'read_mixer.cxx', 'read_mixer.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: [
mixer_glue_dep, mixer_glue_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