diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2022-01-11 15:51:10 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2022-01-11 15:51:10 +0000 |
commit | effb1e09dee263cdac4ec593e8caf316e6f01fe2 (patch) | |
tree | 89786cad619e9b25c61853edd9a9e0ea87891621 /tests | |
parent | ccef398c3c901677780d214844d3c9a03f8eb2cb (diff) | |
download | gobject-introspection-effb1e09dee263cdac4ec593e8caf316e6f01fe2.tar.gz |
build: Avoid the doctemplates hack
The hack that copies the doctemplates directory into the build
directory has stopped working with newer versions of Meson; while it's
possible to copy files, custom_target() cannot depend on a directory.
Additionally, the dependency has always been broken.
Instead, we enumerate the template files—after all, it's not like they
change a lot—and then we list them as dependencies for the test targets.
Fixes: #414
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scanner/meson.build | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build index 5176b957..b81b3fd5 100644 --- a/tests/scanner/meson.build +++ b/tests/scanner/meson.build @@ -525,19 +525,26 @@ foreach gir : test_girs endforeach if has_girdoctool and glib_dep.type_name() == 'pkgconfig' + doctool_env = environment() + doctool_env.set('srcdir', meson.current_source_dir()) + doctool_env.set('builddir', meson.current_build_dir()) + foreach language : ['C', 'Python', 'Gjs'] regress_docs = custom_target( 'generate-docs-' + language, input: regress_gir, - depends: [doc_templates], + depend_files: doc_templates, build_by_default: not cairo_deps_found, + env: doctool_env, output: 'Regress-1.0-' + language, command: [ python, girdoctool, '--add-include-path=' + join_paths(build_root, 'gir'), '--add-include-path=' + meson.current_build_dir(), '--language', language, - '@INPUT@', '-o', '@OUTPUT@'], + '--templates-dir=' + join_paths(meson.current_source_dir(), '../../giscanner/doctemplates'), + '@INPUT@', '-o', '@OUTPUT@', + ], ) if cairo_deps_found @@ -546,10 +553,7 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig' python, args: [gi_tester, 'Regress-1.0-' + language], depends: [regress_docs], - env: [ - 'srcdir=' + meson.current_source_dir(), - 'builddir=' + meson.current_build_dir(), - ], + env: doctool_env, ) endif endforeach @@ -557,9 +561,10 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig' regress_sections = custom_target( 'generate-docs-sections', input: regress_gir, - depends: [doc_templates], + depend_files: [doc_templates], build_by_default: not cairo_deps_found, output: 'Regress-1.0-sections.txt', + env: doctool_env, command: [ python, girdoctool, '--add-include-path=' + join_paths(build_root, 'gir'), @@ -574,10 +579,7 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig' python, args: [gi_tester, 'Regress-1.0-sections.txt'], depends: [regress_sections], - env: [ - 'srcdir=' + meson.current_source_dir(), - 'builddir=' + meson.current_build_dir(), - ], + env: doctool_env, ) endif endif |