summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-07 15:39:43 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-16 10:54:46 +0100
commitb93f018f574a92c680669c35fea37be8d8f73c3f (patch)
tree926663dac1b7b0e2828138f3b61ecddcc684c674 /src/import
parentaf3b864d76cf916a026b7877099791811b348fdf (diff)
downloadsystemd-b93f018f574a92c680669c35fea37be8d8f73c3f.tar.gz
meson: don't compile import sources four times
Use a 'convenience library' to do the compilation once and then link the objects into all the files that need it. Those files are small, so this probably doesn't matter too much for speed, but has the advantage that we don't get the same error four times if something goes wrong. The library is conditionalized in the same way importd itself, because we cannot build it without the deps.
Diffstat (limited to 'src/import')
-rw-r--r--src/import/meson.build92
1 files changed, 41 insertions, 51 deletions
diff --git a/src/import/meson.build b/src/import/meson.build
index b3bc682b0b..e48e49293e 100644
--- a/src/import/meson.build
+++ b/src/import/meson.build
@@ -1,62 +1,52 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
-systemd_importd_sources = files('''
- importd.c
-'''.split())
+systemd_importd_sources = files(
+ 'importd.c')
-systemd_pull_sources = files('''
- pull.c
- pull-raw.c
- pull-raw.h
- pull-tar.c
- pull-tar.h
- pull-job.c
- pull-job.h
- pull-common.c
- pull-common.h
- import-common.c
- import-common.h
- import-compress.c
- import-compress.h
- curl-util.c
- curl-util.h
- qcow2-util.c
- qcow2-util.h
-'''.split())
+systemd_pull_sources = files(
+ 'pull.c',
+ 'pull-raw.c',
+ 'pull-raw.h',
+ 'pull-tar.c',
+ 'pull-tar.h',
+ 'pull-job.c',
+ 'pull-job.h',
+ 'pull-common.c',
+ 'pull-common.h',
+ 'curl-util.c',
+ 'curl-util.h')
-systemd_import_sources = files('''
- import.c
- import-raw.c
- import-raw.h
- import-tar.c
- import-tar.h
- import-common.c
- import-common.h
- import-compress.c
- import-compress.h
- qcow2-util.c
- qcow2-util.h
-'''.split())
+systemd_import_sources = files(
+ 'import.c',
+ 'import-raw.c',
+ 'import-raw.h',
+ 'import-tar.c',
+ 'import-tar.h')
-systemd_import_fs_sources = files('''
- import-fs.c
- import-common.c
- import-common.h
-'''.split())
+systemd_import_fs_sources = files(
+ 'import-fs.c')
-systemd_export_sources = files('''
- export.c
- export-tar.c
- export-tar.h
- export-raw.c
- export-raw.h
- import-common.c
- import-common.h
- import-compress.c
- import-compress.h
-'''.split())
+systemd_export_sources = files(
+ 'export.c',
+ 'export-tar.c',
+ 'export-tar.h',
+ 'export-raw.c',
+ 'export-raw.h')
if conf.get('ENABLE_IMPORTD') == 1
+ lib_import_common = static_library(
+ 'import-common',
+ 'import-common.c',
+ 'import-common.h',
+ 'import-compress.c',
+ 'import-compress.h',
+ 'qcow2-util.c',
+ 'qcow2-util.h',
+ include_directories : includes,
+ dependencies : [libbzip2,
+ libxz,
+ libz])
+
install_data('org.freedesktop.import1.conf',
install_dir : dbuspolicydir)
install_data('org.freedesktop.import1.service',