]> git.ipfire.org Git - thirdparty/systemd.git/commit
meson: avoid double compilation for standalone progs 40148/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 16 Dec 2025 16:38:44 +0000 (17:38 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Dec 2025 12:15:49 +0000 (13:15 +0100)
commit736fc4b479b33699fe74ada31c1e36fbf77dd4c3
treebe7e03d2fdf9b0767565853c684690c49aab8f87
parentb6c86e145a0070aa19f6b1b0d2820079cadc01a7
meson: avoid double compilation for standalone progs

So far we compiled the normal and standalone versions completely
independently. Let's use the 'extract' template pattern to avoid any
additional compilation and only require an single link to produce the
.standalone variants.

Unfortunately, as designed, the 'extract' framework only allows one set of
object files to be extracted. Since we need all the files for the
.standalone version, we cannot use 'extract' for other purposes. Thus, in
the two cases where 'extract' was used for the test binaries, this is now
changed to compile the files a second time. But the number of files in that
list is small, so this seems like a better option.

(If we weren't using the template system, we could easily extract just the
objects we need. But with the current system, at the point of the
definition, the binaries are not defined yet. We'd need to handle all of
this through sets of dictionaries, and that just seems like too much
trouble to avoid double compilation of a few small files.)
meson.build
src/repart/meson.build
src/shutdown/meson.build
src/sysusers/meson.build
src/tmpfiles/meson.build