diff options
author | Thomas Haller <thaller@redhat.com> | 2021-01-28 08:57:23 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-01-28 09:28:25 +0100 |
commit | 98ae351134703b0a085db07982e3e03734fb1d39 (patch) | |
tree | 90703b06096b485a7322f09ebbaaa2c561112f6b | |
parent | 90622e782b82f395aaccd9229f74fe357f6433e5 (diff) | |
download | NetworkManager-98ae351134703b0a085db07982e3e03734fb1d39.tar.gz |
build/meson: cleanup meson files of core
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | src/devices/adsl/meson.build | 15 | ||||
-rw-r--r-- | src/devices/bluetooth/meson.build | 57 | ||||
-rw-r--r-- | src/devices/ovs/meson.build | 31 | ||||
-rw-r--r-- | src/devices/team/meson.build | 27 | ||||
-rw-r--r-- | src/devices/wifi/meson.build | 18 | ||||
-rw-r--r-- | src/devices/wwan/meson.build | 66 | ||||
-rw-r--r-- | src/ppp/meson.build | 24 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/meson.build | 40 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/tests/meson.build | 8 | ||||
-rw-r--r-- | src/settings/plugins/ifupdown/meson.build | 10 | ||||
-rw-r--r-- | src/settings/plugins/ifupdown/tests/meson.build | 8 | ||||
-rw-r--r-- | src/settings/plugins/keyfile/tests/meson.build | 8 |
13 files changed, 149 insertions, 165 deletions
diff --git a/meson.build b/meson.build index a4c832bb95..357fcf6348 100644 --- a/meson.build +++ b/meson.build @@ -584,6 +584,8 @@ enable_bluez5_dun = get_option('bluez5_dun') if enable_bluez5_dun bluez5_dep = dependency('bluez', version: '>= 5', required: false) assert(bluez5_dep.found(), 'Bluez 5.x development headers are required') +else + bluez5_dep = declare_dependency() endif config_h.set10('WITH_BLUEZ5_DUN', enable_bluez5_dun) diff --git a/src/devices/adsl/meson.build b/src/devices/adsl/meson.build index aa9f000b38..8c6263a669 100644 --- a/src/devices/adsl/meson.build +++ b/src/devices/adsl/meson.build @@ -1,13 +1,11 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -sources = files( - 'nm-atm-manager.c', - 'nm-device-adsl.c', -) - libnm_device_plugin_adsl = shared_module( 'nm-device-plugin-adsl', - sources: sources, + sources: files( + 'nm-atm-manager.c', + 'nm-device-adsl.c', + ), dependencies: core_default_dep, c_args: daemon_c_flags, link_args: ldflags_linker_script_devices, @@ -21,5 +19,8 @@ core_plugins += libnm_device_plugin_adsl test( 'check-local-devices-adsl', check_exports, - args: [libnm_device_plugin_adsl.full_path(), linker_script_devices], + args: [ + libnm_device_plugin_adsl.full_path(), + linker_script_devices, + ], ) diff --git a/src/devices/bluetooth/meson.build b/src/devices/bluetooth/meson.build index c6d12f3f8d..d73646971c 100644 --- a/src/devices/bluetooth/meson.build +++ b/src/devices/bluetooth/meson.build @@ -1,26 +1,17 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -sources = files( - 'nm-bluez-manager.c', - 'nm-bt-error.c', - 'nm-device-bt.c', -) - -deps = [ - core_default_dep, - libnm_wwan_dep, -] - -if enable_bluez5_dun - sources += files('nm-bluez5-dun.c') - - deps += bluez5_dep -endif - libnm_device_plugin_bluetooth_static = static_library( 'nm-device-plugin-bluetooth-static', - sources: sources, - dependencies: deps, + sources: files( + 'nm-bluez-manager.c', + 'nm-bt-error.c', + 'nm-device-bt.c', + ) + (enable_bluez5_dun ? files('nm-bluez5-dun.c') : files()), + dependencies: [ + core_default_dep, + libnm_wwan_dep, + bluez5_dep, + ], c_args: daemon_c_flags, ) @@ -28,11 +19,14 @@ libnm_device_plugin_bluetooth_static_dep = declare_dependency( link_whole: libnm_device_plugin_bluetooth_static, ) -deps += libnm_device_plugin_bluetooth_static_dep - libnm_device_plugin_bluetooth = shared_module( 'nm-device-plugin-bluetooth', - dependencies: deps, + dependencies: [ + core_default_dep, + libnm_wwan_dep, + bluez5_dep, + libnm_device_plugin_bluetooth_static_dep, + ], link_args: ldflags_linker_script_devices, link_depends: linker_script_devices, install: true, @@ -45,16 +39,23 @@ core_plugins += libnm_device_plugin_bluetooth test( 'check-local-devices-bluetooth', check_exports, - args: [libnm_device_plugin_bluetooth.full_path(), linker_script_devices], + args: [ + libnm_device_plugin_bluetooth.full_path(), + linker_script_devices + ], ) if enable_tests - test_unit = 'nm-bt-test' - executable( - test_unit, - 'tests/' + test_unit + '.c', - dependencies: [ libNetworkManagerTest_dep, deps ], + 'nm-bt-test', + 'tests/nm-bt-test.c', + dependencies: [ + libNetworkManagerTest_dep, + core_default_dep, + libnm_wwan_dep, + bluez5_dep, + libnm_device_plugin_bluetooth_static_dep, + ], c_args: test_c_flags, ) endif diff --git a/src/devices/ovs/meson.build b/src/devices/ovs/meson.build index e61eeb8d2e..03db173b44 100644 --- a/src/devices/ovs/meson.build +++ b/src/devices/ovs/meson.build @@ -1,22 +1,18 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -sources = files( - 'nm-device-ovs-bridge.c', - 'nm-device-ovs-interface.c', - 'nm-device-ovs-port.c', - 'nm-ovsdb.c', - 'nm-ovs-factory.c', -) - -deps = [ - core_default_dep, - jansson_dep, -] - libnm_device_plugin_ovs = shared_module( 'nm-device-plugin-ovs', - sources: sources, - dependencies: deps, + sources: files( + 'nm-device-ovs-bridge.c', + 'nm-device-ovs-interface.c', + 'nm-device-ovs-port.c', + 'nm-ovsdb.c', + 'nm-ovs-factory.c', + ), + dependencies: [ + core_default_dep, + jansson_dep, + ], c_args: daemon_c_flags, link_args: ldflags_linker_script_devices, link_depends: linker_script_devices, @@ -29,5 +25,8 @@ core_plugins += libnm_device_plugin_ovs test( 'check-local-devices-ovs', check_exports, - args: [libnm_device_plugin_ovs.full_path(), linker_script_devices], + args: [ + libnm_device_plugin_ovs.full_path(), + linker_script_devices, + ], ) diff --git a/src/devices/team/meson.build b/src/devices/team/meson.build index 37814deba4..5a2770dc49 100644 --- a/src/devices/team/meson.build +++ b/src/devices/team/meson.build @@ -1,20 +1,16 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -sources = files( - 'nm-device-team.c', - 'nm-team-factory.c', -) - -deps = [ - core_default_dep, - jansson_dep, - libteamdctl_dep, -] - libnm_device_plugin_team = shared_module( 'nm-device-plugin-team', - sources: sources, - dependencies: deps, + sources: files( + 'nm-device-team.c', + 'nm-team-factory.c', + ), + dependencies: [ + core_default_dep, + jansson_dep, + libteamdctl_dep, + ], c_args: daemon_c_flags, link_args: ldflags_linker_script_devices, link_depends: linker_script_devices, @@ -27,5 +23,8 @@ core_plugins += libnm_device_plugin_team test( 'check-local-devices-team', check_exports, - args: [libnm_device_plugin_team.full_path(), linker_script_devices], + args: [ + libnm_device_plugin_team.full_path(), + linker_script_devices, + ], ) diff --git a/src/devices/wifi/meson.build b/src/devices/wifi/meson.build index 878981fc72..59ebf2d567 100644 --- a/src/devices/wifi/meson.build +++ b/src/devices/wifi/meson.build @@ -8,8 +8,8 @@ if enable_iwd ) endif -libnm_wifi_base = static_library( - 'nm-wifi-base', +libnm_device_plugin_wifi_static = static_library( + 'nm-device-plugin-wifi-static', sources: files( 'nm-device-olpc-mesh.c', 'nm-device-wifi-p2p.c', @@ -23,8 +23,8 @@ libnm_wifi_base = static_library( c_args: daemon_c_flags, ) -libnm_wifi_base_dep = declare_dependency( - link_with: libnm_wifi_base, +libnm_device_plugin_wifi_static_dep = declare_dependency( + link_with: libnm_device_plugin_wifi_static, ) libnm_device_plugin_wifi = shared_module( @@ -32,7 +32,10 @@ libnm_device_plugin_wifi = shared_module( sources: files( 'nm-wifi-factory.c', ), - dependencies: [ core_default_dep, libnm_wifi_base_dep ], + dependencies: [ + core_default_dep, + libnm_device_plugin_wifi_static_dep, + ], c_args: daemon_c_flags, link_args: ldflags_linker_script_devices, link_depends: linker_script_devices, @@ -54,7 +57,10 @@ if enable_tests exe = executable( test_unit, 'tests/' + test_unit + '.c', - dependencies: [ libNetworkManagerTest_dep, libnm_wifi_base_dep ], + dependencies: [ + libNetworkManagerTest_dep, + libnm_device_plugin_wifi_static_dep, + ], c_args: test_c_flags, ) diff --git a/src/devices/wwan/meson.build b/src/devices/wwan/meson.build index 971b7121fa..d9ac36de16 100644 --- a/src/devices/wwan/meson.build +++ b/src/devices/wwan/meson.build @@ -1,29 +1,22 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -nm_service_providers_source = files('nm-service-providers.c') - -sources = nm_service_providers_source + files( - 'nm-modem-broadband.c', - 'nm-modem.c', - 'nm-modem-manager.c', -) - -deps = [ - core_default_dep, - libsystemd_dep, - mm_glib_dep, -] - -if enable_ofono - sources += files('nm-modem-ofono.c') -endif +wwan_inc = include_directories('.') linker_script = join_paths(meson.current_source_dir(), 'libnm-wwan.ver') libnm_wwan = shared_module( 'nm-wwan', - sources: sources, - dependencies: deps, + sources: files( + 'nm-service-providers.c', + 'nm-modem-broadband.c', + 'nm-modem.c', + 'nm-modem-manager.c', + ) + (enable_ofono ? files('nm-modem-ofono.c') : files()), + dependencies: [ + core_default_dep, + libsystemd_dep, + mm_glib_dep, + ], c_args: daemon_c_flags, link_args: '-Wl,--version-script,@0@'.format(linker_script), link_depends: linker_script, @@ -31,8 +24,6 @@ libnm_wwan = shared_module( install_dir: nm_plugindir, ) -wwan_inc = include_directories('.') - libnm_wwan_dep = declare_dependency( include_directories: wwan_inc, link_with: libnm_wwan, @@ -43,18 +34,23 @@ core_plugins += libnm_wwan test( 'check-wwan', check_exports, - args: [libnm_wwan.full_path(), linker_script], -) - -sources = files( - 'nm-device-modem.c', - 'nm-wwan-factory.c', + args: [ + libnm_wwan.full_path(), + linker_script, + ], ) libnm_device_plugin_wwan = shared_module( 'nm-device-plugin-wwan', - sources: sources, - dependencies: deps, + sources: files( + 'nm-device-modem.c', + 'nm-wwan-factory.c', + ), + dependencies: [ + core_default_dep, + libsystemd_dep, + mm_glib_dep, + ], c_args: daemon_c_flags, link_with: libnm_wwan, link_args: ldflags_linker_script_devices, @@ -73,18 +69,18 @@ run_target( ) if enable_tests - test_unit = 'test-service-providers' - exe = executable( - test_unit, - ['tests/' + test_unit + '.c'] + nm_service_providers_source, + 'test-service-providers', + files( + 'tests/test-service-providers.c', + 'nm-service-providers.c', + ), include_directories: wwan_inc, dependencies: libNetworkManagerTest_dep, c_args: test_c_flags, ) - test( - 'wwan/' + test_unit, + 'wwan/test-service-providers', test_script, timeout: default_test_timeout, args: test_args + [exe.full_path()], diff --git a/src/ppp/meson.build b/src/ppp/meson.build index 70f0b231e0..4999a23830 100644 --- a/src/ppp/meson.build +++ b/src/ppp/meson.build @@ -1,29 +1,25 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -name = 'nm-pppd-plugin' - -c_flags = [ - '-DG_LOG_DOMAIN="@0@"'.format(name), - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB', -] - nm_pppd_plugin = shared_module( - name, + 'nm-pppd-plugin', name_prefix: '', - sources: name + '.c', + sources: 'nm-pppd-plugin.c', dependencies: libnm_core_nm_default_dep, - c_args: c_flags, + c_args: [ + '-DG_LOG_DOMAIN="nm-pppd-plugin"', + '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB', + ], install: true, install_dir: pppd_plugin_dir, ) -name = 'nm-ppp-plugin' - linker_script = join_paths(meson.current_source_dir(), 'nm-ppp-plugin.ver') core_plugins += shared_module( - name, - sources: 'nm-ppp-manager.c', + 'nm-ppp-plugin', + sources: [ + 'nm-ppp-manager.c', + ], dependencies: core_default_dep, c_args: daemon_c_flags, link_args: '-Wl,--version-script,@0@'.format(linker_script), diff --git a/src/settings/plugins/ifcfg-rh/meson.build b/src/settings/plugins/ifcfg-rh/meson.build index 370eec4c57..4162c67f48 100644 --- a/src/settings/plugins/ifcfg-rh/meson.build +++ b/src/settings/plugins/ifcfg-rh/meson.build @@ -5,44 +5,38 @@ install_data( install_dir: dbus_conf_dir, ) -name = 'nmdbus-ifcfg-rh' - dbus_sources = gnome.gdbus_codegen( - name, + 'nmdbus-ifcfg-rh', 'nm-ifcfg-rh.xml', interface_prefix: 'com.redhat', namespace: 'NMDBus', ) libnmdbus_ifcfg_rh = static_library( - name, + 'nmdbus-ifcfg-rh', sources: dbus_sources, dependencies: glib_dep, c_args: introspection_extra_cflags, ) -core_sources = files( - 'nms-ifcfg-rh-reader.c', - 'nms-ifcfg-rh-utils.c', - 'nms-ifcfg-rh-writer.c', - 'shvar.c', -) - libnms_ifcfg_rh_core = static_library( 'nms-ifcfg-rh-core', - sources: core_sources, + sources: files( + 'nms-ifcfg-rh-reader.c', + 'nms-ifcfg-rh-utils.c', + 'nms-ifcfg-rh-writer.c', + 'shvar.c', + ), dependencies: core_default_dep, c_args: daemon_c_flags, ) -sources = [dbus_sources] + core_sources + files( - 'nms-ifcfg-rh-storage.c', - 'nms-ifcfg-rh-plugin.c', -) - libnm_settings_plugin_ifcfg_rh = shared_module( 'nm-settings-plugin-ifcfg-rh', - sources: sources, + sources: files( + 'nms-ifcfg-rh-storage.c', + 'nms-ifcfg-rh-plugin.c', + ), dependencies: core_default_dep, c_args: daemon_c_flags, link_with: libnms_ifcfg_rh_core, @@ -54,13 +48,11 @@ libnm_settings_plugin_ifcfg_rh = shared_module( core_plugins += libnm_settings_plugin_ifcfg_rh -data = [ - 'nm-ifdown', - 'nm-ifup', -] - install_data( - data, + [ + 'nm-ifdown', + 'nm-ifup', + ], install_dir: nm_libexecdir, install_mode: 'rwxr-xr-x', ) diff --git a/src/settings/plugins/ifcfg-rh/tests/meson.build b/src/settings/plugins/ifcfg-rh/tests/meson.build index 8956456985..077e4782f0 100644 --- a/src/settings/plugins/ifcfg-rh/tests/meson.build +++ b/src/settings/plugins/ifcfg-rh/tests/meson.build @@ -1,17 +1,15 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_unit = 'test-ifcfg-rh' - exe = executable( - test_unit, - test_unit + '.c', + 'test-ifcfg-rh', + 'test-ifcfg-rh.c', dependencies: libNetworkManagerTest_dep, c_args: test_c_flags, link_with: libnms_ifcfg_rh_core, ) test( - 'ifcfg-rh/' + test_unit, + 'ifcfg-rh/test-ifcfg-rh', test_script, timeout: 90, args: test_args + [exe.full_path()], diff --git a/src/settings/plugins/ifupdown/meson.build b/src/settings/plugins/ifupdown/meson.build index c582d14c16..b19d92c2c1 100644 --- a/src/settings/plugins/ifupdown/meson.build +++ b/src/settings/plugins/ifupdown/meson.build @@ -1,13 +1,11 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -sources = files( - 'nms-ifupdown-interface-parser.c', - 'nms-ifupdown-parser.c', -) - libnms_ifupdown_core = static_library( 'nms-ifupdown-core', - sources: sources, + sources: files( + 'nms-ifupdown-interface-parser.c', + 'nms-ifupdown-parser.c', + ), dependencies: core_default_dep, c_args: daemon_c_flags, ) diff --git a/src/settings/plugins/ifupdown/tests/meson.build b/src/settings/plugins/ifupdown/tests/meson.build index 8f77f595f5..882287cb2f 100644 --- a/src/settings/plugins/ifupdown/tests/meson.build +++ b/src/settings/plugins/ifupdown/tests/meson.build @@ -1,17 +1,15 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_unit = 'test-ifupdown' - exe = executable( - test_unit, - test_unit + '.c', + 'test-ifupdown', + 'test-ifupdown.c', dependencies: libNetworkManagerTest_dep, c_args: test_c_flags, link_with: libnms_ifupdown_core, ) test( - 'ifupdown/' + test_unit, + 'ifupdown/test-ifupdown', test_script, args: test_args + [exe.full_path()], ) diff --git a/src/settings/plugins/keyfile/tests/meson.build b/src/settings/plugins/keyfile/tests/meson.build index cc2397df92..3c89bcf99a 100644 --- a/src/settings/plugins/keyfile/tests/meson.build +++ b/src/settings/plugins/keyfile/tests/meson.build @@ -1,16 +1,14 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_unit = 'test-keyfile-settings' - exe = executable( - test_unit, - test_unit + '.c', + 'test-keyfile-settings', + 'test-keyfile-settings.c', dependencies: libNetworkManagerTest_dep, c_args: test_c_flags, ) test( - test_unit, + 'test-keyfile-settings', test_script, args: test_args + [exe.full_path()], timeout: default_test_timeout, |