From 6bc14424b40b0741112737859b576ed9533f099a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 19 Jun 2017 19:05:42 -0400 Subject: Use absolute path to target dir within gnome module. Stuff like gtkdoc may not be run in the top-level build directory, so these paths need to be absolute. Fixes #1950. --- mesonbuild/modules/gnome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 6ec70403c..3c80a0940 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -294,7 +294,7 @@ class GnomeModule(ExtensionModule): else: link_command = ['-l' + lib.name] if isinstance(lib, build.SharedLibrary): - libdir = state.backend.get_target_dir(lib) + libdir = os.path.join(state.environment.get_build_dir(), state.backend.get_target_dir(lib)) link_command.append('-L' + libdir) # Needed for the following binutils bug: # https://github.com/mesonbuild/meson/issues/1911 -- cgit v1.2.3 From ca798e1538e18d12cef5ba44a587737a7f137a01 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 19 Jun 2017 19:07:09 -0400 Subject: Add all internal dep rpaths to gnome module builds. Running gtkdoc on a shared library that depends on another shared library would fail otherwise. --- mesonbuild/modules/gnome.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 3c80a0940..f395eaff6 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -303,6 +303,8 @@ class GnomeModule(ExtensionModule): for d in state.backend.determine_rpath_dirs(lib): d = os.path.join(state.environment.get_build_dir(), d) link_command.append('-L' + d) + if include_rpath: + link_command.append('-Wl,-rpath,' + d) if include_rpath: link_command.append('-Wl,-rpath,' + libdir) if depends: -- cgit v1.2.3 From 12c997b804301570939c728aabd063f19ce456be Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 19 Jun 2017 19:53:58 -0400 Subject: Add example of generated header in docs. --- .../frameworks/10 gtk-doc/doc/foobar-docs.sgml | 1 + .../frameworks/10 gtk-doc/include/foo-version.h.in | 29 ++++++++++++++++++++++ .../frameworks/10 gtk-doc/include/meson.build | 10 ++++++++ test cases/frameworks/10 gtk-doc/meson.build | 4 ++- 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 test cases/frameworks/10 gtk-doc/include/foo-version.h.in create mode 100644 test cases/frameworks/10 gtk-doc/include/meson.build diff --git a/test cases/frameworks/10 gtk-doc/doc/foobar-docs.sgml b/test cases/frameworks/10 gtk-doc/doc/foobar-docs.sgml index d23b22fe4..028b80830 100644 --- a/test cases/frameworks/10 gtk-doc/doc/foobar-docs.sgml +++ b/test cases/frameworks/10 gtk-doc/doc/foobar-docs.sgml @@ -34,6 +34,7 @@ + diff --git a/test cases/frameworks/10 gtk-doc/include/foo-version.h.in b/test cases/frameworks/10 gtk-doc/include/foo-version.h.in new file mode 100644 index 000000000..30751cd75 --- /dev/null +++ b/test cases/frameworks/10 gtk-doc/include/foo-version.h.in @@ -0,0 +1,29 @@ +#pragma once + +/** + * SECTION:version + * @section_id: foo-version + * @short_description: foo-version.h + * @title: Foo Versioning + */ + +/** + * FOO_MAJOR_VERSION: + * + * The major version of foo. + */ +#define FOO_MAJOR_VERSION (@FOO_MAJOR_VERSION@) + +/** + * FOO_MINOR_VERSION: + * + * The minor version of foo. + */ +#define FOO_MINOR_VERSION (@FOO_MINOR_VERSION@) + +/** + * FOO_MICRO_VERSION: + * + * The micro version of foo. + */ +#define FOO_MICRO_VERSION (@FOO_MICRO_VERSION@) diff --git a/test cases/frameworks/10 gtk-doc/include/meson.build b/test cases/frameworks/10 gtk-doc/include/meson.build new file mode 100644 index 000000000..4c85b801d --- /dev/null +++ b/test cases/frameworks/10 gtk-doc/include/meson.build @@ -0,0 +1,10 @@ +cdata = configuration_data() +parts = meson.project_version().split('.') +cdata.set('FOO_MAJOR_VERSION', parts[0]) +cdata.set('FOO_MINOR_VERSION', parts[1]) +cdata.set('FOO_MICRO_VERSION', parts[2]) +configure_file(input : 'foo-version.h.in', + output : 'foo-version.h', + configuration : cdata, + install : true, + install_dir : get_option('includedir')) diff --git a/test cases/frameworks/10 gtk-doc/meson.build b/test cases/frameworks/10 gtk-doc/meson.build index 95eeefa70..4cfcca182 100644 --- a/test cases/frameworks/10 gtk-doc/meson.build +++ b/test cases/frameworks/10 gtk-doc/meson.build @@ -1,4 +1,4 @@ -project('gtkdoctest', 'c') +project('gtkdoctest', 'c', version : '1.0.0') gnome = import('gnome') @@ -6,6 +6,8 @@ assert(gnome.gtkdoc_html_dir('foobar') == 'share/gtkdoc/html/foobar', 'Gtkdoc in inc = include_directories('include') +subdir('include') + # We have to disable this test until this bug fix has landed to # distros https://bugzilla.gnome.org/show_bug.cgi?id=753145 error('MESON_SKIP_TEST can not enable gtk-doc test until upstream fixes have landed.') -- cgit v1.2.3 From 70776cda98b65803eac7f847041ec3768bc37267 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 19 Jun 2017 20:52:12 -0400 Subject: Add build include directory to gtkdoc source paths. This enables gtkdoc to produce documentation on files that were generated, using configure_file, for example. --- mesonbuild/modules/gnome.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index f395eaff6..7d539aa87 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -702,6 +702,8 @@ class GnomeModule(ExtensionModule): for inc_dir in src_dir.get_incdirs(): header_dirs.append(os.path.join(state.environment.get_source_dir(), src_dir.get_curdir(), inc_dir)) + header_dirs.append(os.path.join(state.environment.get_build_dir(), + src_dir.get_curdir(), inc_dir)) else: header_dirs.append(src_dir) -- cgit v1.2.3