diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-04-14 18:10:58 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-05-03 12:29:41 +0200 |
commit | 9a01fe3906682eeb0fe29fb8ef9cadd1dff353e1 (patch) | |
tree | 50f08d12932d054c0197537ff0ee25c76ba6bdb3 /meson.build | |
parent | d9c8f075af486791319fde78b5d7248195b6e5e3 (diff) | |
download | systemd-9a01fe3906682eeb0fe29fb8ef9cadd1dff353e1.tar.gz |
meson: avoid building executables that won't be installed
When executable() or custom_target() has install: that is conditional as is
false (i.e. not install:true), it won't be built by default. (build_by_default:
defaults to install:). But if that program is added to public_programs, it will
be build by default because it is pulled in by the test, effectively defeating
the disablement.
While at it, make 'ukify' follow the same pattern as 'kernel-install'.
They will be used later together.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/meson.build b/meson.build index c6dfc7709c..2b0f89f83d 100644 --- a/meson.build +++ b/meson.build @@ -2507,7 +2507,9 @@ exe = executable( versiondep], install_rpath : rootpkglibdir, install : conf.get('ENABLE_ANALYZE') == 1) -public_programs += exe +if conf.get('ENABLE_ANALYZE') == 1 + public_programs += exe +endif if want_tests != 'false' test('test-compare-versions', @@ -4353,7 +4355,9 @@ exe = custom_target( install : want_kernel_install, install_mode : 'rwxr-xr-x', install_dir : bindir) -public_programs += exe +if want_kernel_install + public_programs += exe +endif if want_tests != 'false' and want_kernel_install test('test-kernel-install', @@ -4362,15 +4366,15 @@ if want_tests != 'false' and want_kernel_install args : [exe.full_path(), loaderentry_install]) endif -if want_ukify - exe = custom_target( +exe = custom_target( 'ukify', input : 'src/ukify/ukify.py', output : 'ukify', command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], - install : true, + install : want_ukify, install_mode : 'rwxr-xr-x', install_dir : rootlibexecdir) +if want_ukify public_programs += exe endif |