]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: allow .standalone version to be always built
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 16 Dec 2025 15:55:55 +0000 (16:55 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Dec 2025 12:14:19 +0000 (13:14 +0100)
Allow .standalone version to be built on-demand, even if -Dstandalone=false
is configured. In other words, this changes the meson option from a hard
disablement to a soft "build is on/off by default".

The meson config was originally written in this way but we lost this feature
after the transition to templates. It is nice to build additional targets on
demand during development, so add this back.

meson.build

index 4746146a986d857491a239c784e1544ccede2b7a..37ee1c81ebe2be34405f66405f515a4f1c968e81 100644 (file)
@@ -2517,6 +2517,7 @@ foreach dict : executables
 
         is_test = name.startswith('test-')
         is_fuzz = name.startswith('fuzz-')
+        is_standalone = name.endswith('.standalone')
 
         build = true
         foreach cond : dict.get('conditions', [])
@@ -2529,17 +2530,13 @@ foreach dict : executables
                 continue
         endif
 
-        if name.endswith('.standalone') and not have_standalone_binaries
-                continue
-        endif
-
         exe_sources = dict.get('sources', []) + dict.get('extract', [])
 
         kwargs = {}
         foreach key, val : dict
                 if key in ['name', 'dbus', 'public', 'conditions', 'type', 'suite',
                            'timeout', 'parallel', 'objects', 'sources', 'extract',
-                           'include_directories']
+                           'include_directories', 'build_by_default']
                         continue
                 endif
 
@@ -2579,17 +2576,21 @@ foreach dict : executables
                 endforeach
         endif
 
+        build_by_default = dict.get('build_by_default',
+                                    have_standalone_binaries or not is_standalone)
+
         exe = executable(
                 name,
                 sources : exe_sources,
                 kwargs : kwargs,
                 implicit_include_directories : false,
                 include_directories : include_directories,
+                build_by_default: build_by_default,
         )
 
         executables_by_name += { name : exe }
 
-        if not name.endswith('.standalone')
+        if not is_standalone
                 sources += exe_sources
         endif
 
@@ -2602,7 +2603,7 @@ foreach dict : executables
                 }
         endif
 
-        if dict.get('build_by_default', true)
+        if build_by_default
                 if dict.get('dbus', false)
                         dbus_programs += exe
                 endif