]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: move declarations of networkd and friends
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Jun 2023 18:40:54 +0000 (03:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Aug 2023 12:37:31 +0000 (21:37 +0900)
meson.build
src/network/meson.build

index 9b943a411b5600b38f733a6a15c387e8b3ef0286..94eff0cace068fcdf74b8af218d0135487303d0b 100644 (file)
@@ -2683,52 +2683,8 @@ if want_tests != 'false'
              args : ['verify', '--resolve-names=never', all_rules])
 endif
 
-if conf.get('ENABLE_NETWORKD') == 1
-        dbus_programs += executable(
-                'systemd-networkd',
-                systemd_networkd_sources,
-                include_directories : network_includes,
-                link_with : [libnetworkd_core,
-                             libsystemd_network,
-                             networkd_link_with],
-                dependencies : [threads,
-                                userspace],
-                install_rpath : pkglibdir,
-                install : true,
-                install_dir : libexecdir)
-
-        public_programs += executable(
-                'systemd-networkd-wait-online',
-                systemd_networkd_wait_online_sources,
-                include_directories : includes,
-                link_with : [networkd_link_with],
-                dependencies : [userspace],
-                install_rpath : pkglibdir,
-                install : true,
-                install_dir : libexecdir)
-
-        public_programs += executable(
-                'networkctl',
-                networkctl_sources,
-                include_directories : libsystemd_network_includes,
-                link_with : [libsystemd_network,
-                             networkd_link_with],
-                dependencies : [userspace],
-                install_rpath : pkglibdir,
-                install : true)
-endif
-
-exe = executable(
-        'systemd-network-generator',
-        network_generator_sources,
-        include_directories : includes,
-        link_with : [networkd_link_with],
-        dependencies : [userspace],
-        install_rpath : pkglibdir,
-        install : true,
-        install_dir : libexecdir)
-
 if want_tests != 'false'
+        exe = executables_by_name.get('systemd-network-generator')
         test('test-network-generator-conversion',
              test_network_generator_conversion_sh,
              # https://github.com/mesonbuild/meson/issues/2681
index dab77a0d22b92a68a3f64af92bd0f9d7761fb68c..23d9cefc26ef012da5bc0ce10f4dcad87c4c176c 100644 (file)
@@ -150,6 +150,45 @@ libnetworkd_core = static_library(
         link_with : networkd_link_with,
         build_by_default : false)
 
+executables += [
+        libexec_template + {
+                'name' : 'systemd-networkd',
+                'dbus' : true,
+                'conditions' : ['ENABLE_NETWORKD'],
+                'sources' : systemd_networkd_sources,
+                'include_directories' : network_includes,
+                'link_with' : [
+                        libnetworkd_core,
+                        libsystemd_network,
+                        networkd_link_with,
+                ],
+                'dependencies' : threads,
+        },
+        libexec_template + {
+                'name' : 'systemd-networkd-wait-online',
+                'public' : true,
+                'conditions' : ['ENABLE_NETWORKD'],
+                'sources' : systemd_networkd_wait_online_sources,
+                'link_with' : networkd_link_with,
+        },
+        executable_template + {
+                'name' : 'networkctl',
+                'public' : true,
+                'conditions' : ['ENABLE_NETWORKD'],
+                'sources' : networkctl_sources,
+                'include_directories' : libsystemd_network_includes,
+                'link_with' : [
+                        libsystemd_network,
+                        networkd_link_with,
+                ],
+        },
+        libexec_template + {
+                'name' : 'systemd-network-generator',
+                'sources' : network_generator_sources,
+                'link_with' : networkd_link_with,
+        },
+]
+
 if conf.get('ENABLE_NETWORKD') == 1
         install_data('org.freedesktop.network1.conf',
                      install_dir : dbuspolicydir)