From b62ee354dd68349812f0526622c4e164b4a89f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 14 Apr 2023 18:19:48 +0200 Subject: meson: allow building .standalone on demand We can always build the standalone version whenever we build the normal version (the dependencies are the same). In most builds standalone binaries would be disabled. But it is occasionally useful to have them for testing, so move the conditional to install:, so the binaries can be build by giving the explicit target name. The default of 'build_by_default' for executable() is sadly true (since meson 0.38.0), so need to specify build_by_default: too. Also add systemd-shutdown.standalone to public_programs for additional testing. --- meson.build | 125 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 65 insertions(+), 60 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 2b0f89f83d..88ef5679c5 100644 --- a/meson.build +++ b/meson.build @@ -4008,20 +4008,21 @@ if enable_sysusers args : exe.full_path()) endif + exe = executable( + 'systemd-sysusers.standalone', + 'src/sysusers/sysusers.c', + include_directories : includes, + c_args : '-DSTANDALONE', + link_with : [libshared_static, + libbasic, + libbasic_gcrypt, + libsystemd_static], + dependencies : [userspace, + versiondep], + build_by_default: have_standalone_binaries, + install : have_standalone_binaries, + install_dir : rootbindir) if have_standalone_binaries - exe = executable( - 'systemd-sysusers.standalone', - 'src/sysusers/sysusers.c', - include_directories : includes, - c_args : '-DSTANDALONE', - link_with : [libshared_static, - libbasic, - libbasic_gcrypt, - libsystemd_static], - dependencies : [userspace, - versiondep], - install : true, - install_dir : rootbindir) public_programs += exe if want_tests != 'false' @@ -4054,21 +4055,22 @@ if conf.get('ENABLE_TMPFILES') == 1 args : exe.full_path()) endif + exe = executable( + 'systemd-tmpfiles.standalone', + systemd_tmpfiles_sources, + include_directories : includes, + c_args : '-DSTANDALONE', + link_with : [libshared_static, + libbasic, + libbasic_gcrypt, + libsystemd_static], + dependencies : [libacl, + userspace, + versiondep], + build_by_default: have_standalone_binaries, + install : have_standalone_binaries, + install_dir : rootbindir) if have_standalone_binaries - exe = executable( - 'systemd-tmpfiles.standalone', - systemd_tmpfiles_sources, - include_directories : includes, - c_args : '-DSTANDALONE', - link_with : [libshared_static, - libbasic, - libbasic_gcrypt, - libsystemd_static], - dependencies : [libacl, - userspace, - versiondep], - install : true, - install_dir : rootbindir) public_programs += exe if want_tests != 'false' @@ -4168,26 +4170,27 @@ if conf.get('ENABLE_REPART') == 1 install_dir : rootbindir) public_programs += exe + exe = executable( + 'systemd-repart.standalone', + systemd_repart_sources, + include_directories : includes, + c_args : '-DSTANDALONE', + link_with : [libshared_static, + libbasic, + libbasic_gcrypt, + libsystemd_static, + libshared_fdisk], + dependencies : [libblkid, + libfdisk, + libopenssl, + threads, + userspace, + versiondep], + build_by_default: have_standalone_binaries, + install_rpath : rootpkglibdir, + install : have_standalone_binaries, + install_dir : rootbindir) if have_standalone_binaries - exe = executable( - 'systemd-repart.standalone', - systemd_repart_sources, - include_directories : includes, - c_args : '-DSTANDALONE', - link_with : [libshared_static, - libbasic, - libbasic_gcrypt, - libsystemd_static, - libshared_fdisk], - dependencies : [libblkid, - libfdisk, - libopenssl, - threads, - userspace, - versiondep], - install_rpath : rootpkglibdir, - install : true, - install_dir : rootbindir) public_programs += exe endif endif @@ -4204,21 +4207,23 @@ executable( install : true, install_dir : rootlibexecdir) +executable( + 'systemd-shutdown.standalone', + systemd_shutdown_sources, + include_directories : includes, + c_args : '-DSTANDALONE', + link_with : [libshared_static, + libbasic, + libsystemd_static], + dependencies : [libmount, + userspace, + versiondep], + build_by_default: have_standalone_binaries, + install_rpath : rootpkglibdir, + install : have_standalone_binaries, + install_dir : rootlibexecdir) if have_standalone_binaries - executable( - 'systemd-shutdown.standalone', - systemd_shutdown_sources, - include_directories : includes, - c_args : '-DSTANDALONE', - link_with : [libshared_static, - libbasic, - libsystemd_static], - dependencies : [libmount, - userspace, - versiondep], - install_rpath : rootpkglibdir, - install : true, - install_dir : rootlibexecdir) + public_programs += exe endif executable( -- cgit v1.2.1