[gtkmm] Fix build as subproject without building documentation
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Fix build as subproject without building documentation
- Date: Fri, 14 May 2021 14:54:03 +0000 (UTC)
commit 9b397d84f6ff61abab907bdbb7833bad897b2c39
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Fri May 14 16:40:47 2021 +0200
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.
docs/reference/meson.build | 34 ++++++++++++++++++----------------
meson.build | 23 +++++++++++++++--------
2 files changed, 33 insertions(+), 24 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index d52fa0c9..43db6da5 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -5,7 +5,7 @@
# gtkmm_extra_h_files, gdkmm_built_h_file_targets,
# gtkmm_built_h_file_targets, install_datadir, python3,
# doc_reference_py, build_documentation, 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++',
@@ -19,21 +19,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 358f8ad0..ebc975a4 100644
--- a/meson.build
+++ b/meson.build
@@ -163,7 +163,11 @@ gtkmm_requires = ' '.join(gtkmm_requires)
# reference 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) # Used by gmmproc (in glibmm)
perl = find_program('perl', required: maintainer_mode or build_documentation)
@@ -293,7 +297,7 @@ if can_add_dist_script
'win32_installer',
]
# Add build scripts to the distribution directory, and delete .gitignore
- # files and an empty $MESON_DIST_ROOT/build/ directory.
+ # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
meson.add_dist_script(
python3.path(), dist_build_scripts_py,
project_source_root,
@@ -303,14 +307,17 @@ if can_add_dist_script
endif
if meson.is_subproject()
+ pkgconfig_vars = {
+ 'gmmprocm4dir': project_source_root / 'tools' / 'm4',
+ 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
+ 'htmlrefpub': 'http://library.gnome.org/devel/' + pkg_conf_data.get_unquoted('PACKAGE_TARNAME') +
'/unstable/'
+ }
+ if build_documentation
+ pkgconfig_vars += {'doxytagfile': tag_file.full_path()}
+ endif
gtkmm_dep = declare_dependency(
dependencies: gtkmm_own_dep,
- variables: {
- 'gmmprocm4dir': project_source_root / 'tools' / 'm4',
- 'doxytagfile': tag_file.full_path(),
- 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html',
- 'htmlrefpub': 'http://library.gnome.org/devel/' + pkg_conf_data.get_unquoted('PACKAGE_TARNAME') +
'/unstable/'
- }
+ variables: pkgconfig_vars,
)
# A main project that looks for gtkmm_pcname.pc shall find gtkmm_dep.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]