From b93f018f574a92c680669c35fea37be8d8f73c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 7 Dec 2021 15:39:43 +0100 Subject: 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. --- src/import/meson.build | 92 ++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 51 deletions(-) (limited to 'src/import/meson.build') 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', -- cgit v1.2.1