From 94a75c8cd6cc4dcf8ce89ad3a941bf003499378a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 9 Feb 2021 12:46:47 +0100 Subject: cloud-setup: build intermediate library "libnm-cloud-setup-core.a" Next we'll add unit tests, hence we need to link against the code but we don't want to compile it twice. --- clients/cloud-setup/meson.build | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'clients/cloud-setup') diff --git a/clients/cloud-setup/meson.build b/clients/cloud-setup/meson.build index 5b48229971..729fd10ace 100644 --- a/clients/cloud-setup/meson.build +++ b/clients/cloud-setup/meson.build @@ -21,10 +21,9 @@ if install_systemdunitdir endif -executable( - 'nm-cloud-setup', - files( - 'main.c', +libnm_cloud_setup_core = static_library( + 'nm-cloud-setup-core', + sources: files( 'nm-cloud-setup-utils.c', 'nm-http-client.c', 'nmcs-provider-ec2.c', @@ -41,6 +40,28 @@ executable( c_args: [ '-DG_LOG_DOMAIN="nm-cloud-setup"', ], +) + +libnm_cloud_setup_core_dep = declare_dependency( + include_directories: include_directories('.'), + link_with: libnm_cloud_setup_core, +) + +executable( + 'nm-cloud-setup', + files( + 'main.c', + ), + dependencies: [ + libnmc_base_dep, + libnmc_dep, + libcurl_dep, + libnm_libnm_aux_dep, + libnm_cloud_setup_core_dep, + ], + c_args: [ + '-DG_LOG_DOMAIN="nm-cloud-setup"', + ], link_with: libnm_systemd_logging_stub, link_args: ldflags_linker_script_binary, link_depends: linker_script_binary, -- cgit v1.2.1