build/meson: cleanup dispatcher/meson.build

This commit is contained in:
Thomas Haller 2021-02-04 14:16:29 +01:00
parent ab2dcc3289
commit a9202a0f3d
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 28 additions and 26 deletions

View file

@ -2,8 +2,6 @@
dispatcher_inc = include_directories('.')
name = 'nm-dispatcher'
configure_file(
input: 'org.freedesktop.nm_dispatcher.service.in',
output: '@BASENAME@',
@ -16,36 +14,39 @@ install_data(
install_dir: dbus_conf_dir,
)
deps = [
libnm_dep,
libnm_nm_default_dep,
libnm_libnm_aux_dep,
]
c_flags = [
'-DG_LOG_DOMAIN="@0@"'.format(name),
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
]
libnm_dispatcher_core = static_library(
name + '-core',
'nm-dispatcher-core',
sources: 'nm-dispatcher-utils.c',
dependencies: deps,
c_args: c_flags,
dependencies: [
libnm_dep,
libnm_nm_default_dep,
libnm_libnm_aux_dep,
],
c_args: [
'-DG_LOG_DOMAIN="nm-dispatcher"',
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
],
)
nmdbus_dispatcher_sources = gnome.gdbus_codegen(
'nmdbus-dispatcher',
name + '.xml',
'nm-dispatcher.xml',
interface_prefix: 'org.freedesktop',
namespace: 'NMDBus',
)
executable(
name,
name + '.c',
dependencies: deps,
c_args: c_flags,
'nm-dispatcher',
'nm-dispatcher.c',
dependencies: [
libnm_dep,
libnm_nm_default_dep,
libnm_libnm_aux_dep,
],
c_args: [
'-DG_LOG_DOMAIN="nm-dispatcher"',
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
],
link_with: libnm_dispatcher_core,
link_args: ldflags_linker_script_binary,
link_depends: linker_script_binary,

View file

@ -1,10 +1,11 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
test_unit = 'test-dispatcher-envp'
exe = executable(
test_unit,
[test_unit + '.c', nmdbus_dispatcher_sources],
'test-dispatcher-envp',
[
'test-dispatcher-envp.c',
nmdbus_dispatcher_sources,
],
include_directories: dispatcher_inc,
dependencies: [
libnm_nm_default_dep,
@ -18,7 +19,7 @@ exe = executable(
)
test(
'dispatcher/' + test_unit,
'dispatcher/test-dispatcher-envp',
test_script,
args: test_args + [exe.full_path()],
)