summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2021-05-14 15:25:02 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2021-05-14 15:27:43 +0200
commit589260e9c473f738c3254fb3f1930f196fd77e74 (patch)
treec4895ea4b00ed642b8b1295c1c474d8455222c83
parenta5a4cbdc2c762a155fc9a33b68e7297b2a0a3e73 (diff)
Fix build as subproject without building documentation
* meson.build: If mm-common-get is not found in maintainer-mode with 'required: false', try with 'required: true'. Don't try to use tag_file, if documentation is not built. * docs/reference/meson.build: Don't use variables from modules that don't define doxytagfile. These are subprojects that don't build their documentation.
-rw-r--r--docs/reference/meson.build32
-rw-r--r--meson.build20
2 files changed, 30 insertions, 22 deletions
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 70c2e1b..a9cfc4d 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -3,7 +3,7 @@
# Input: project_build_root, project_source_root, cairomm_pcname,
# build_documentation, source_h_files, install_datadir, python3,
# doc_reference_py, can_add_dist_script
-# Output: install_docdir, install_devhelpdir, book_name, tag_file
+# Output: install_docdir, install_devhelpdir, if build_documentation: tag_file
# There are no built source files in cairomm.
@@ -16,21 +16,23 @@ docinstall_flags = []
foreach module : tag_file_modules
depmod = dependency(module, required: false)
if depmod.found()
- doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile')
- htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '')
- htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '')
- if htmlrefpub == ''
- htmlrefpub = htmlrefdir
- elif htmlrefdir == ''
- htmlrefdir = htmlrefpub
- endif
- doxygen_tagfiles += ' "' + doxytagfile + '=' + htmlrefpub + '"'
+ doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '')
+ if doxytagfile != ''
+ htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '')
+ htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '')
+ if htmlrefpub == ''
+ htmlrefpub = htmlrefdir
+ elif htmlrefdir == ''
+ htmlrefdir = htmlrefpub
+ endif
+ doxygen_tagfiles += ' "' + doxytagfile + '=' + htmlrefpub + '"'
- # Doxygen <= 1.8.15
- docinstall_flags += ['-l', doxytagfile.split('/')[-1] + '@' + htmlrefdir]
- if htmlrefpub != htmlrefdir
- # Doxygen >= 1.8.16
- docinstall_flags += ['-l', 's@' + htmlrefpub + '@' + htmlrefdir]
+ # Doxygen <= 1.8.15
+ docinstall_flags += ['-l', doxytagfile.split('/')[-1] + '@' + htmlrefdir]
+ if htmlrefpub != htmlrefdir
+ # Doxygen >= 1.8.16
+ docinstall_flags += ['-l', 's@' + htmlrefpub + '@' + htmlrefdir]
+ endif
endif
endif
endforeach
diff --git a/meson.build b/meson.build
index b5d58e7..c490382 100644
--- a/meson.build
+++ b/meson.build
@@ -133,8 +133,11 @@ endif
mm_common_get = find_program('mm-common-get', required: false)
if maintainer_mode and not mm_common_get.found()
- error('Maintainer mode requires the \'mm-common-get\' command.\n' +
- 'Use \'-Dmaintainer-mode=false\' or install the \'mm-common\' package, version 1.0.0 or higher')
+ message('Maintainer mode requires the \'mm-common-get\' command. If it is not found,\n' +
+ 'use \'-Dmaintainer-mode=false\' or install the \'mm-common\' package, version 1.0.0 or higher.')
+ # If meson --wrap-mode != forcefallback, Meson falls back to the mm-common
+ # subproject only if mm-common-get is required.
+ mm_common_get = find_program('mm-common-get', required: true)
endif
perl = find_program('perl', required: build_documentation)
@@ -280,13 +283,16 @@ if can_add_dist_script
endif
if meson.is_subproject()
+ pkgconfig_vars = {
+ 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
+ 'htmlrefpub': 'http://www.cairographics.org/documentation/cairomm/reference'
+ }
+ if build_documentation
+ pkgconfig_vars += {'doxytagfile': tag_file.full_path()}
+ endif
cairomm_dep = declare_dependency(
dependencies: cairomm_own_dep,
- variables: {
- 'doxytagfile': tag_file.full_path(),
- 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
- 'htmlrefpub': 'http://www.cairographics.org/documentation/cairomm/reference'
- }
+ variables: pkgconfig_vars,
)
# A main project that looks for cairomm_pcname.pc shall find cairomm_dep.