]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Suppress 'requires' clauses for doxygen if doxygen is too old. 15264/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 24 May 2023 17:50:32 +0000 (11:50 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 24 May 2023 17:50:32 +0000 (11:50 -0600)
doc/doxygen/CMakeLists.txt
doc/doxygen/options.dox.in
include/deal.II/base/config.h.in

index fe8c67820cb58bd5186fcf7f6592d5b910171ced..ddec30ab9b3d161850a21d5fcebe100503788b45 100644 (file)
@@ -32,6 +32,8 @@ if(NOT DOXYGEN_FOUND)
   message(FATAL_ERROR
     "Could not find doxygen which is required for building the documentation"
     )
+else()
+  message(STATUS "Using doxygen version ${DOXYGEN_VERSION}")
 endif()
 
 
@@ -285,6 +287,22 @@ if(NOT (${DOXYGEN_VERSION} VERSION_LESS 1.9))
 endif()
 
 
+# doxygen version 1.9.1 can not correctly parse C++20-style 'requires'
+# clauses and just drops certain classes and shows documentation for
+# DEAL_II_CXX20_REQUIRES instead. 1.9.7 gets this right, but has other
+# bugs. It's unclear for versions inbetween. Err on the safe side, and
+# only make them visible to doxygen if we have at least 1.9.8.
+if(${DOXYGEN_VERSION} VERSION_LESS 1.9.8)
+  message(STATUS "Suppressing 'requires' clause parsing because doxygen is too old")
+  file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/options.dox"
+    "
+    PREDEFINED += DEAL_II_DOXYGEN_DO_NOT_PARSE_REQUIRES_CLAUSES=1
+    PREDEFINED += DEAL_II_CXX20_REQUIRES(x)=
+    "
+    )
+endif()
+
+
 
 ########################################################################
 #
index 9af33e651098797fa093c0ec8d4bc3b5d1c8d4c8..963ace9cbe82fd03b77dc9b4d94c006b9bc3af61 100644 (file)
@@ -186,7 +186,6 @@ PREDEFINED             = DOXYGEN=1 \
                          DEAL_II_HOST_DEVICE= \
                          DEAL_II_ALWAYS_INLINE= \
                          __device__= \
-                        DEAL_II_CXX20_REQUIRES(x)= \
                          DEAL_II_WITH_ADOLC=1 \
                          DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING=1 \
                          DEAL_II_ADOLC_WITH_ATRIG_ERF=1 \
index 6cf17cf239e8a91401708b77f62c9efa62b5f24b..350e38efcd6b67045afa9e8b6859727f638588bb 100644 (file)
  * define a convenience macro that allows us to write a 'requires'
  * clause that is simply removed when not using C++20.
  */
-#ifdef DEAL_II_HAVE_CXX20
+#if defined(DEAL_II_HAVE_CXX20) && !defined(DEAL_II_DOXYGEN_DO_NOT_PARSE_REQUIRES_CLAUSES)
 #  define DEAL_II_CXX20_REQUIRES(condition) requires(condition)
 #else
 #  define DEAL_II_CXX20_REQUIRES(condition)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.