From 568a4ff8b18e58c09b72655a4a3c046a11da08cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 19 Dec 2017 22:46:01 +0100 Subject: [PATCH] meson: use a convenience lib for shared resolve files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reduces the man=false meson target count from 1281 to 1253. -- A fully scientific test: git grep _sources, :/*.build|cut -d: -f2|tr -d ' '|sort|uniq -c reveals that libudev_sources is the only source list now reused twice. There's some ugly circular dependency between libudev and libshared, and anyway I'm not sure if we don't want to use different compilation options (LOG_REALM_…) in those two cases, so I'm leaving that alone for now. --- meson.build | 6 ++++-- src/resolve/meson.build | 33 ++++++++++++++++----------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/meson.build b/meson.build index e73b24dedbb..516cc69adc4 100644 --- a/meson.build +++ b/meson.build @@ -1505,7 +1505,8 @@ if conf.get('ENABLE_RESOLVE') == 1 systemd_resolved_sources, include_directories : includes, link_with : [libshared, - libbasic_gcrypt], + libbasic_gcrypt, + libsystemd_resolve_core], dependencies : [threads, libgpg_error, libm, @@ -1518,7 +1519,8 @@ if conf.get('ENABLE_RESOLVE') == 1 systemd_resolve_sources, include_directories : includes, link_with : [libshared, - libbasic_gcrypt], + libbasic_gcrypt, + libsystemd_resolve_core], dependencies : [threads, libgpg_error, libm, diff --git a/src/resolve/meson.build b/src/resolve/meson.build index ee1acb51669..15752d24ffd 100644 --- a/src/resolve/meson.build +++ b/src/resolve/meson.build @@ -31,7 +31,7 @@ basic_dns_sources = files(''' dns_type_h = files('dns-type.h')[0] -systemd_resolved_only_sources = files(''' +systemd_resolved_sources = files(''' resolved.c resolved-manager.c resolved-manager.h @@ -80,7 +80,7 @@ systemd_resolved_only_sources = files(''' resolved-etc-hosts.c '''.split()) -systemd_resolve_only_sources = files('resolve-tool.c') +systemd_resolve_sources = files('resolve-tool.c') ############################################################ @@ -141,14 +141,13 @@ resolved_dnssd_gperf_c = custom_target( output : 'resolved-dnssd-gperf.c', command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) -systemd_resolved_sources = (basic_dns_sources + - [resolved_gperf_c, resolved_dnssd_gperf_c] + - systemd_resolved_only_sources + - dns_type_headers) +libsystemd_resolve_core = static_library( + 'systemd-resolve-core', + basic_dns_sources, + dns_type_headers, + include_directories : includes) -systemd_resolve_sources = (basic_dns_sources + - systemd_resolve_only_sources + - dns_type_headers) +systemd_resolved_sources += [resolved_gperf_c, resolved_dnssd_gperf_c] if conf.get('ENABLE_RESOLVE') == 1 install_data('org.freedesktop.resolve1.conf', @@ -178,37 +177,37 @@ endif tests += [ [['src/resolve/test-resolve-tables.c', - basic_dns_sources, dns_type_headers, 'src/shared/test-tables.h'], - [], + [libsystemd_resolve_core, + libshared], [libgcrypt, libgpg_error, libm], 'ENABLE_RESOLVE'], [['src/resolve/test-dns-packet.c', - basic_dns_sources, dns_type_headers], - [], + [libsystemd_resolve_core, + libshared], [libgcrypt, libgpg_error, libm], 'ENABLE_RESOLVE'], [['src/resolve/test-resolved-packet.c', - basic_dns_sources, dns_type_headers], - [], + [libsystemd_resolve_core, + libshared], [libgcrypt, libgpg_error, libm], 'ENABLE_RESOLVE'], [['src/resolve/test-dnssec.c', - basic_dns_sources, dns_type_headers], - [], + [libsystemd_resolve_core, + libshared], [libgcrypt, libgpg_error, libm], -- 2.47.3