Skip to content

Commit aa35dd4

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 b9caa40 commit aa35dd4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docs/docs/reference/meson.build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tag_file_modules = [
1313
'mm-common-libstdc++',
1414
]
1515
doxygen_tagfiles = ''
16+
doxygen_tag_targets = []
1617
docinstall_flags = []
1718
foreach module : tag_file_modules
1819
depmod = dependency(module, required: false)
@@ -29,6 +30,14 @@ foreach module : tag_file_modules
2930
htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', default_value: '')
3031
endif
3132
if doxytagfile != ''
33+
if depmod.type_name() == 'internal'
34+
# Subprojects must build their tag files before doxygen is called.
35+
if module.startswith('mm-common')
36+
doxygen_tag_targets += subproject('mm-common').get_variable('global_tag_file_target')
37+
else
38+
doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target')
39+
endif
40+
endif
3241
if htmlrefpub == ''
3342
htmlrefpub = htmlrefdir
3443
elif htmlrefdir == ''
@@ -60,7 +69,7 @@ doc_conf_data.set('abs_top_srcdir', project_source_root)
6069
doc_conf_data.set('SIGCXX_API_VERSION', sigcxx_api_version)
6170
doc_conf_data.set('DOXYGEN_TAGFILES', doxygen_tagfiles)
6271

63-
configure_file(
72+
doxyfile = configure_file(
6473
input: 'Doxyfile.in',
6574
output: '@BASENAME@',
6675
configuration: doc_conf_data,
@@ -96,6 +105,8 @@ tag_file = custom_target('html_and_tag',
96105
'@OUTPUT@',
97106
'@INPUT@',
98107
],
108+
depend_files: doxyfile,
109+
depends: doxygen_tag_targets,
99110
build_by_default: build_documentation,
100111
install: true,
101112
install_dir: install_reference_docdir,

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ if meson.is_subproject()
256256
}
257257
if build_documentation
258258
pkgconfig_vars += {'doxytagfile': tag_file.full_path()}
259+
# May be used in a main project.
260+
global_tag_file_target = tag_file
259261
endif
260262
sigcxx_dep = declare_dependency(
261263
dependencies: sigcxx_own_dep,

0 commit comments

Comments
 (0)