Commit f8096448 authored by Thomas Haller's avatar Thomas Haller

build: don't link dispatcher with generated nmdbus-dispatcher bindings

We don't need it anymore.

Still, for tests let gdbus-codegen run and generate the sources and
compile them. We want to keep "dispatcher/nm-dispatcher.xml" and ensure
that it is still valid.
parent cdaedeca
......@@ -3885,6 +3885,25 @@ EXTRA_DIST += \
# dispatcher
###############################################################################
dispatcher_nmdbus_dispatcher_sources = \
dispatcher/nmdbus-dispatcher.h \
dispatcher/nmdbus-dispatcher.c \
$(NULL)
dispatcher/nmdbus-dispatcher.h: dispatcher/nm-dispatcher.xml
@$(MKDIR_P) dispatcher/
$(AM_V_GEN) gdbus-codegen \
--generate-c-code $(basename $@) \
--c-namespace NMDBus \
--interface-prefix org.freedesktop \
$<
dispatcher/nmdbus-dispatcher.c: dispatcher/nmdbus-dispatcher.h
CLEANFILES += $(dispatcher_nmdbus_dispatcher_sources)
###############################################################################
libexec_PROGRAMS += dispatcher/nm-dispatcher
noinst_LTLIBRARIES += \
......@@ -3905,25 +3924,6 @@ dispatcher_cppflags = \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
$(NULL)
dispatcher_nmdbus_dispatcher_sources = \
dispatcher/nmdbus-dispatcher.h \
dispatcher/nmdbus-dispatcher.c
dispatcher/nmdbus-dispatcher.h: dispatcher/nm-dispatcher.xml
@$(MKDIR_P) dispatcher/
$(AM_V_GEN) gdbus-codegen \
--generate-c-code $(basename $@) \
--c-namespace NMDBus \
--interface-prefix org.freedesktop \
$<
dispatcher/nmdbus-dispatcher.c: dispatcher/nmdbus-dispatcher.h
$(dispatcher_nm_dispatcher_OBJECTS): $(dispatcher_nmdbus_dispatcher_sources)
CLEANFILES += $(dispatcher_nmdbus_dispatcher_sources)
dispatcher_libnm_dispatcher_core_la_SOURCES = \
dispatcher/nm-dispatcher-utils.c \
dispatcher/nm-dispatcher-utils.h \
......@@ -3939,8 +3939,6 @@ dispatcher_nm_dispatcher_SOURCES = \
dispatcher/nm-dispatcher.c \
$(NULL)
nodist_dispatcher_nm_dispatcher_SOURCES = $(dispatcher_nmdbus_dispatcher_sources)
dispatcher_nm_dispatcher_CPPFLAGS = $(dispatcher_cppflags)
dispatcher_nm_dispatcher_LDFLAGS = \
......@@ -3998,12 +3996,21 @@ dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \
-I$(srcdir)/libnm \
-I$(builddir)/libnm \
-I$(srcdir)/dispatcher \
-I$(builddir)/dispatcher \
-DNETWORKMANAGER_COMPILATION_TEST \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
$(GLIB_CFLAGS) \
$(SANITIZER_EXEC_CFLAGS) \
$(NULL)
dispatcher_tests_test_dispatcher_envp_SOURCES = \
dispatcher/tests/test-dispatcher-envp.c \
$(NULL)
nodist_dispatcher_tests_test_dispatcher_envp_SOURCES = $(dispatcher_nmdbus_dispatcher_sources)
$(dispatcher_tests_test_dispatcher_envp_OBJECTS): $(dispatcher_nmdbus_dispatcher_sources)
dispatcher_tests_test_dispatcher_envp_LDFLAGS = \
$(SANITIZER_EXEC_LDFLAGS) \
$(NULL)
......
......@@ -44,7 +44,7 @@ libnm_dispatcher_core = static_library(
sources = files('nm-dispatcher.c')
sources += gnome.gdbus_codegen(
nmdbus_dispatcher_sources = gnome.gdbus_codegen(
'nmdbus-dispatcher',
name + '.xml',
interface_prefix: 'org.freedesktop',
......
......@@ -7,7 +7,7 @@ incs = [
exe = executable(
test_unit,
test_unit + '.c',
[ test_unit + '.c' ] + [ nmdbus_dispatcher_sources ],
include_directories: incs,
dependencies: libnm_core_dep,
c_args: [
......
......@@ -28,6 +28,8 @@
#include "nm-utils/nm-test-utils.h"
#include "nmdbus-dispatcher.h"
#define TEST_DIR NM_BUILD_SRCDIR"/dispatcher/tests"
/*****************************************************************************/
......@@ -637,6 +639,17 @@ test_up_empty_vpn_iface (void)
/*****************************************************************************/
static void
test_gdbus_codegen (void)
{
gs_unref_object NMDBusDispatcher *dbus_dispatcher = NULL;
dbus_dispatcher = nmdbus_dispatcher_skeleton_new ();
g_assert (NMDBUS_IS_DISPATCHER_SKELETON (dbus_dispatcher));
}
/*****************************************************************************/
NMTST_DEFINE ();
int
......@@ -653,6 +666,8 @@ main (int argc, char **argv)
g_test_add_func ("/dispatcher/up_empty_vpn_iface", test_up_empty_vpn_iface);
g_test_add_func ("/dispatcher/gdbus-codegen", test_gdbus_codegen);
return g_test_run ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment