build/meson: cleanup meson files of core

This commit is contained in:
Thomas Haller 2021-01-28 08:57:23 +01:00
parent 90622e782b
commit 98ae351134
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
13 changed files with 149 additions and 165 deletions

View file

@ -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)

View file

@ -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,
],
)

View file

@ -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

View file

@ -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,
],
)

View file

@ -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,
],
)

View file

@ -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,
)

View file

@ -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()],

View file

@ -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),

View file

@ -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',
)

View file

@ -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()],

View file

@ -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,
)

View file

@ -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()],
)

View file

@ -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,