From 7be6a143da14d44fbdef9c62f19fadaa1cb495cc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 26 Jun 2023 03:40:54 +0900 Subject: [PATCH] meson: move declarations of networkd and friends --- meson.build | 46 +---------------------------------------- src/network/meson.build | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 45 deletions(-) diff --git a/meson.build b/meson.build index 9b943a411b5..94eff0cace0 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/src/network/meson.build b/src/network/meson.build index dab77a0d22b..23d9cefc26e 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -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) -- 2.47.3