summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2018-03-23 21:20:23 +0100
committerIñigo Martínez <inigomartinez@gmail.com>2018-03-26 22:45:20 +0200
commit06c28a632d738b0141b619ea1c500d2563a20298 (patch)
treee550e4f269719f159df6e50efdbd5fa875ac5ec9 /common
parentf2163d2daf55f950e63df7dd8bf2b991dd1afa71 (diff)
downloadgvfs-06c28a632d738b0141b619ea1c500d2563a20298.tar.gz
build: Apply a workaround for D-Bus code generation
meson uses `gdbus-codegen` for D-Bus code generation. However, both files are generated implicitly, so meson is not able to know how many files are generated, so it does generate only one opaque target that represents the two files. A new script has been created only to call `gdbus-codegen` and simulate the generation of the source code and header as different targets. Please see: https://bugzilla.gnome.org/show_bug.cgi?id=791015 https://github.com/mesonbuild/meson/pull/2930 https://bugzilla.gnome.org/show_bug.cgi?id=794365
Diffstat (limited to 'common')
-rw-r--r--common/meson.build18
1 files changed, 12 insertions, 6 deletions
diff --git a/common/meson.build b/common/meson.build
index 226d98b3..e269cb7d 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -14,18 +14,23 @@ sources = files(
'gvfsutils.c'
)
-sources += gnome.gdbus_codegen(
- 'gvfsdbus',
- gvfs_namespace + '.xml',
- interface_prefix: gvfs_namespace + '.',
- namespace: 'GVfsDBus'
+# FIXME: Ugly workaround that simulates the generation of
+# two different targets.
+namespace = 'GVfsDBus'
+name = namespace.to_lower()
+
+dbus_sources = custom_target(
+ name,
+ input: gvfs_namespace + '.xml',
+ output: [name + '.c', name + '.h'],
+ command: [codegen, gvfs_namespace + '.', name, namespace, meson.current_build_dir(), '@INPUT@', '@OUTPUT@']
)
cflags = common_cflags + ['-DREMOTE_VOLUME_MONITORS_DIR="@0@"'.format(gvfs_remote_volume_monitors_dir)]
libgvfscommon = shared_library(
'gvfscommon',
- sources: sources,
+ sources: sources + [dbus_sources],
include_directories: top_inc,
dependencies: glib_deps,
c_args: cflags,
@@ -34,6 +39,7 @@ libgvfscommon = shared_library(
)
libgvfscommon_dep = declare_dependency(
+ sources: dbus_sources[1],
link_with: libgvfscommon,
include_directories: common_inc
)