]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Don't define targets for standalone binaries if option is not enabled 37531/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 11:08:50 +0000 (13:08 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 12:05:58 +0000 (14:05 +0200)
These are built from the same sources as the regular binaries, so we
end up with the same sources multiple times in the compilation database
but with different command line arguments, which trips up tooling that
uses the compilation database. Let's not define the standalone targets if
the option is not enabled to avoid this problem.

meson.build
src/repart/meson.build
src/shutdown/meson.build
src/sysusers/meson.build
src/tmpfiles/meson.build

index 5dd5f348aa79fc91e64d8f85d241aab0da231221..733390ae8f671248615476efde64c8d9b01790c4 100644 (file)
@@ -2424,6 +2424,10 @@ foreach dict : executables
                 continue
         endif
 
+        if name.endswith('.standalone') and not have_standalone_binaries
+                continue
+        endif
+
         kwargs = {}
         foreach key, val : dict
                 if key in ['name', 'dbus', 'public', 'conditions',
index 9c5778dffdc9d230cd87bd716e9a9fa4b10f08c2..369410bab8d635419b0d56579f0071269facaabe 100644 (file)
@@ -22,7 +22,7 @@ executables += [
         },
         executable_template + {
                 'name' : 'systemd-repart.standalone',
-                'public' : have_standalone_binaries,
+                'public' : true,
                 'sources' : files('repart.c'),
                 'c_args' : '-DSTANDALONE',
                 'link_with' : [
@@ -37,8 +37,6 @@ executables += [
                         libopenssl,
                         threads,
                 ],
-                'build_by_default' : have_standalone_binaries,
-                'install' : have_standalone_binaries,
         },
 ]
 
index c91253ca8e0f84e3b548b7242a4c3df238fce4e5..c67d19abcc573e46b22463fd19a8b91de9902484 100644 (file)
@@ -28,8 +28,6 @@ executables += [
                         libsystemd_static,
                 ],
                 'dependencies' : libmount,
-                'build_by_default' : have_standalone_binaries,
-                'install' : have_standalone_binaries,
         },
         test_template + {
                 'sources' : files('test-umount.c'),
index c968f55110cd0ac062e4d6521aae39dabf295da3..88494d8cfce1866f63632a90bd0c4756fc9f26ca 100644 (file)
@@ -13,7 +13,7 @@ executables += [
         },
         executable_template + {
                 'name' : 'systemd-sysusers.standalone',
-                'public' : have_standalone_binaries,
+                'public' : true,
                 'sources' : files('sysusers.c'),
                 'c_args' : '-DSTANDALONE',
                 'link_with' : [
@@ -22,7 +22,5 @@ executables += [
                         libsystemd_static,
                 ],
                 'dependencies' : libaudit,
-                'build_by_default' : have_standalone_binaries,
-                'install' : have_standalone_binaries,
         },
 ]
index 1016573969a262fee45c02a32c9fde3232820884..404f265f918b52ccc67cd7c5be62875d387bed44 100644 (file)
@@ -21,7 +21,7 @@ executables += [
         },
         executable_template + {
                 'name' : 'systemd-tmpfiles.standalone',
-                'public' : have_standalone_binaries,
+                'public' : true,
                 'sources' : systemd_tmpfiles_sources + systemd_tmpfiles_extract_sources,
                 'c_args' : '-DSTANDALONE',
                 'link_with' : [
@@ -30,8 +30,6 @@ executables += [
                         libsystemd_static,
                 ],
                 'dependencies' : libacl,
-                'build_by_default' : have_standalone_binaries,
-                'install' : have_standalone_binaries,
         },
         test_template + {
                 'sources' : files('test-offline-passwd.c'),