]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use a convenience lib for shared resolve files
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Dec 2017 21:46:01 +0000 (22:46 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 3 Jan 2018 11:09:46 +0000 (12:09 +0100)
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
src/resolve/meson.build

index e73b24dedbb0ea4104328d8d0e0637e0b85237e5..516cc69adc4e3779122ed1eb8f49dd81e1a96483 100644 (file)
@@ -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,
index ee1acb51669cf642b0e08d9eb5950680c20cf294..15752d24ffdf3158a390d0fd857970bc4c3b4182 100644 (file)
@@ -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],