summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2021-05-14 11:17:14 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2021-05-14 11:17:14 +0200
commitb19b4eabfb207e01709031aee67d758b5cabc34b (patch)
treedcfae66d7edce420682c1054a1ff4af41e1b5859
parent9e8a77a05e9de41abd227325727be8366a0af1cc (diff)
downloadsigc++-b19b4eabfb207e01709031aee67d758b5cabc34b.tar.gz
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. Fixes #71
-rw-r--r--docs/reference/meson.build33
-rw-r--r--meson.build19
2 files changed, 31 insertions, 21 deletions
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 669da3e..ca7ab2a 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -5,6 +5,7 @@
# built_h_files, install_datadir, python3, doc_reference,
# built_h_file_targets, can_add_dist_script
# Output: install_docdir, install_devhelpdir, tag_file
+# Output: install_docdir, install_devhelpdir, if build_documentation: tag_file
tag_file_modules = [
'mm-common-libstdc++',
@@ -14,21 +15,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 + '"'
-
- # Doxygen <= 1.8.15
- docinstall_flags += ['-l', doxytagfile.split('/')[-1] + '@' + htmlrefdir]
- if htmlrefpub != htmlrefdir
- # Doxygen >= 1.8.16
- docinstall_flags += ['-l', 's@' + htmlrefpub + '@' + htmlrefdir]
+ 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]
+ endif
endif
endif
endforeach
diff --git a/meson.build b/meson.build
index 66c4c07..da72505 100644
--- a/meson.build
+++ b/meson.build
@@ -107,7 +107,11 @@ endif
# if documentation shall be built.
mm_common_get = find_program('mm-common-get', required: false)
if maintainer_mode and not mm_common_get.found()
- error('mm-common-get not found. mm-common >= 1.0.0 is required.')
+ message('Maintainer mode requires the \'mm-common-get\' command. If it is not found,\n' +
+ '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
m4 = find_program('m4', required: maintainer_mode) # For building C++ code
perl = find_program('perl', required: build_documentation)
@@ -246,13 +250,16 @@ if can_add_dist_script
endif
if meson.is_subproject()
+ pkgconfig_vars = {
+ 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
+ 'htmlrefpub': 'http://library.gnome.org/devel/libsigc++/unstable/'
+ }
+ if build_documentation
+ pkgconfig_vars += {'doxytagfile': tag_file.full_path()}
+ endif
sigcxx_dep = declare_dependency(
dependencies: sigcxx_own_dep,
- variables: {
- 'doxytagfile': tag_file.full_path(),
- 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
- 'htmlrefpub': 'http://library.gnome.org/devel/libsigc++/unstable/'
- }
+ variables: pkgconfig_vars,
)
# A main project that looks for sigcxx_pcname.pc shall find sigcxx_dep.