Skip to content

Commit 465ea8c

Browse files
committed
Add dependencies to Doxygen tag files in subprojects
Doxygen in a main project shall not be called before tag files have been created or updated in subprojects.
1 parent c71105b commit 465ea8c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docs/reference/meson.build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ tag_file_modules = [
1212
'mm-common-libstdc++',
1313
]
1414
doxygen_tagfiles = ''
15+
doxygen_tag_targets = []
1516
docinstall_flags = []
1617
foreach module : tag_file_modules
1718
depmod = dependency(module, required: false)
1819
if depmod.found()
1920
doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '')
2021
if doxytagfile != ''
22+
if depmod.type_name() == 'internal'
23+
# Subprojects must build their tag files before doxygen is called.
24+
if module.startswith('mm-common')
25+
doxygen_tag_targets += subproject('mm-common').get_variable('global_tag_file_target')
26+
else
27+
doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target')
28+
endif
29+
endif
2130
htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '')
2231
htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '')
2332
if htmlrefpub == ''
@@ -51,7 +60,7 @@ doc_conf_data.set('abs_top_srcdir', project_source_root)
5160
doc_conf_data.set('LIBXMLXX_MODULE_NAME', book_name)
5261
doc_conf_data.set('DOXYGEN_TAGFILES', doxygen_tagfiles)
5362

54-
configure_file(
63+
doxyfile = configure_file(
5564
input: 'Doxyfile.in',
5665
output: '@BASENAME@',
5766
configuration: doc_conf_data,
@@ -87,6 +96,8 @@ tag_file = custom_target('html_and_tag',
8796
'@OUTPUT@',
8897
'@INPUT@',
8998
],
99+
depend_files: doxyfile,
100+
depends: doxygen_tag_targets,
90101
build_by_default: build_documentation,
91102
install: true,
92103
install_dir: install_reference_docdir,

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ if meson.is_subproject()
330330
}
331331
if build_documentation
332332
pkgconfig_vars += {'doxytagfile': tag_file.full_path()}
333+
# May be used in a main project.
334+
global_tag_file_target = tag_file
333335
endif
334336
xmlxx_dep = declare_dependency(
335337
dependencies: xmlxx_own_dep,

0 commit comments

Comments
 (0)