From 95fb6ef29ca44ff1fbeb4bf340a19004d3f6ba3d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 18 May 2021 09:45:15 +0200 Subject: 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. --- docs/reference/meson.build | 17 ++++++++++++++--- meson.build | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/reference/meson.build b/docs/reference/meson.build index ca7ab2a..59d41e8 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -4,19 +4,27 @@ # sigcxx_api_version, build_documentation, source_h_files, # 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++', ] doxygen_tagfiles = '' +doxygen_tag_targets = [] docinstall_flags = [] foreach module : tag_file_modules depmod = dependency(module, required: false) if depmod.found() doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '') if doxytagfile != '' + if depmod.type_name() == 'internal' + # Subprojects must build their tag files before doxygen is called. + if module.startswith('mm-common') + doxygen_tag_targets += subproject('mm-common').get_variable('global_tag_file_target') + else + doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target') + endif + endif htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '') htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '') if htmlrefpub == '' @@ -50,7 +58,7 @@ doc_conf_data.set('abs_top_srcdir', project_source_root) doc_conf_data.set('SIGCXX_API_VERSION', sigcxx_api_version) doc_conf_data.set('DOXYGEN_TAGFILES', doxygen_tagfiles) -configure_file( +doxyfile = configure_file( input: 'Doxyfile.in', output: '@BASENAME@', configuration: doc_conf_data, @@ -96,8 +104,9 @@ if built_h_file_targets.length() > 0 blt_h_files, '@INPUT@', ], + depend_files: doxyfile, + depends: built_h_file_targets + doxygen_tag_targets, build_by_default: build_documentation, - depends: built_h_file_targets, install: true, install_dir: install_reference_docdir, ) @@ -112,6 +121,8 @@ else '@OUTPUT@', '@INPUT@', ], + depend_files: doxyfile, + depends: doxygen_tag_targets, build_by_default: build_documentation, install: true, install_dir: install_reference_docdir, diff --git a/meson.build b/meson.build index da72505..ddb8148 100644 --- a/meson.build +++ b/meson.build @@ -256,6 +256,8 @@ if meson.is_subproject() } if build_documentation pkgconfig_vars += {'doxytagfile': tag_file.full_path()} + # May be used in a main project. + global_tag_file_target = tag_file endif sigcxx_dep = declare_dependency( dependencies: sigcxx_own_dep, -- cgit v1.2.1