summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-04-14 18:19:48 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-05-03 12:29:41 +0200
commitb62ee354dd68349812f0526622c4e164b4a89f5f (patch)
tree846ea4cccf557d1ac3e24d5c2ff25186c163515f /meson.build
parent9a01fe3906682eeb0fe29fb8ef9cadd1dff353e1 (diff)
downloadsystemd-b62ee354dd68349812f0526622c4e164b4a89f5f.tar.gz
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.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build125
1 files changed, 65 insertions, 60 deletions
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(