From 560a8d8a579d2d406748c1a8964f0db93c6fec55 Mon Sep 17 00:00:00 2001 From: R Kent James Date: Thu, 27 Jun 2024 15:19:16 -0400 Subject: [PATCH] Use existence of doxygen directory to set C++ API line (#124) --- rosdoc2/verbs/build/builders/sphinx_builder.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rosdoc2/verbs/build/builders/sphinx_builder.py b/rosdoc2/verbs/build/builders/sphinx_builder.py index 1f611be..2dd2bd3 100644 --- a/rosdoc2/verbs/build/builders/sphinx_builder.py +++ b/rosdoc2/verbs/build/builders/sphinx_builder.py @@ -367,12 +367,15 @@ def __init__(self, builder_name, builder_entry_dictionary, build_context): def build(self, *, doc_build_folder, output_staging_directory): """Actually do the build.""" # Check that doxygen_xml_directory exists relative to output staging, if specified. + has_cpp = False if self.doxygen_xml_directory is not None: self.doxygen_xml_directory = \ os.path.join(output_staging_directory, self.doxygen_xml_directory) self.doxygen_xml_directory = os.path.abspath(self.doxygen_xml_directory) - if not os.path.isdir(self.doxygen_xml_directory): + if os.path.isdir(self.doxygen_xml_directory): + has_cpp = True + else: self.doxygen_xml_directory = None logger.info('No doxygen_xml_directory found, apparently doxygen did not run') if self.build_context.always_run_doxygen: @@ -469,8 +472,6 @@ def build(self, *, doc_build_folder, output_staging_directory): build_context.always_run_sphinx_apidoc or \ build_context.ament_cmake_python - always_run_doxygen = build_context.always_run_doxygen - has_cpp = build_context.build_type in ['ament_cmake', 'cmake'] or always_run_doxygen self.template_variables.update({ 'has_python': has_python, 'has_cpp': has_cpp,