From 1b6adbfa07d9926c2312f05562bb91d535c9c182 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 27 Apr 2018 23:07:30 +0300 Subject: [PATCH 04/16] Install generated gdbus header with old glib version too. --- mesonbuild/modules/gnome.py | 6 +++++- test cases/frameworks/7 gnome/gdbus/meson.build | 4 +++- test cases/frameworks/7 gnome/installed_files.txt | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index abefe057..9003bc75 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -959,11 +959,15 @@ This will become a hard error in the future.''') self._print_gdbus_warning() cmd += ['--generate-c-code', '@OUTDIR@/' + namebase, '@INPUT@'] outputs = [namebase + '.c', namebase + '.h'] + install = kwargs.get('install_header', False) custom_kwargs = {'input': xml_files, 'output': outputs, 'command': cmd, - 'build_by_default': build_by_default + 'build_by_default': build_by_default, + 'install' : install, } + if install and 'install_dir' in kwargs: + custom_kwargs['install_dir'] = [False, kwargs['install_dir']] ct = build.CustomTarget(target_name, state.subdir, state.subproject, custom_kwargs) # Ensure that the same number (and order) of arguments are returned # regardless of the gdbus-codegen (glib) version being used diff --git a/test cases/frameworks/7 gnome/gdbus/meson.build b/test cases/frameworks/7 gnome/gdbus/meson.build index 68ad706f..46259318 100644 --- a/test cases/frameworks/7 gnome/gdbus/meson.build +++ b/test cases/frameworks/7 gnome/gdbus/meson.build @@ -14,7 +14,9 @@ gdbus_src = gnome.gdbus_codegen('generated-gdbus', annotations : [ ['com.example.Hello()', 'org.freedesktop.DBus.Deprecated', 'true'] ], - docbook : 'generated-gdbus-doc' + docbook : 'generated-gdbus-doc', + install_header : true, + install_dir : get_option('includedir') ) assert(gdbus_src.length() == 3, 'expected 3 targets') diff --git a/test cases/frameworks/7 gnome/installed_files.txt b/test cases/frameworks/7 gnome/installed_files.txt index ac132efb..7502888d 100644 --- a/test cases/frameworks/7 gnome/installed_files.txt +++ b/test cases/frameworks/7 gnome/installed_files.txt @@ -15,3 +15,4 @@ usr/share/gir-1.0/MesonDep2-1.0.gir usr/share/glib-2.0/schemas/com.github.meson.gschema.xml usr/share/simple-resources.gresource usr/include/simple-resources.h +usr/include/generated-gdbus.h -- 2.17.0