Skip to content

Commit 8df718e

Browse files
authored
Merge pull request #1512 from NVIDIA/doxygen-fixes
help doxygen produce more useful output
2 parents f7308ea + a343f41 commit 8df718e

6 files changed

Lines changed: 49 additions & 44 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ option(STDEXEC_BUILD_EXAMPLES "Build stdexec examples" ON)
525525

526526
# Configure documentation
527527
if(STDEXEC_BUILD_DOCS)
528-
add_subdirectory(docs)
528+
add_subdirectory(docs EXCLUDE_FROM_ALL)
529529
endif()
530530

531531
# Configure test executables

docs/CMakeLists.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ file(GLOB_RECURSE STDEXEC_PUBLIC_HEADERS ${STDEXEC_PUBLIC_HEADER_DIR}/*.hpp)
2323

2424
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/include)
2525
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/build/doxygen)
26+
set(DOXYGEN_EXCLUDE_DIR ${PROJECT_SOURCE_DIR}/include/execpools)
2627
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/xml/index.xml)
2728
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
2829
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
30+
set(COMPILATION_DB_PATH ${PROJECT_SOURCE_DIR})
31+
32+
# Find the location of stddef.h
33+
execute_process(COMMAND echo "#include <stddef.h>"
34+
COMMAND c++ -xc -dI -E -
35+
COMMAND grep -oP "/usr/.*(?=/stddef\.h)"
36+
COMMAND tail -n 1
37+
OUTPUT_VARIABLE STDDEF_INCLUDE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
38+
message(STATUS "<stddef.h> include path: ${STDDEF_INCLUDE_PATH}")
2939

3040
# Replace variables inside @@ with the current values
3141
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
@@ -61,17 +71,18 @@ add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
6171
${SPHINX_EXECUTABLE} -b html
6272
# Tell Breathe where to find the Doxygen output
6373
-Dbreathe_projects.stdexec=${DOXYGEN_OUTPUT_DIR}/xml
64-
${SPHINX_SOURCE} ${SPHINX_BUILD}
74+
${SPHINX_SOURCE} ${SPHINX_BUILD}
6575
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
6676
DEPENDS
67-
# Other docs files you want to track should go here (or in some variable)
68-
${STDEXEC_DOCUMENTATION_SOURCE_FILES}
69-
${DOXYGEN_INDEX_FILE}
77+
# Other docs files you want to track should go here (or in some variable)
78+
${STDEXEC_DOCUMENTATION_SOURCE_FILES}
79+
${DOXYGEN_INDEX_FILE}
7080
MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py
7181
COMMENT "Generating documentation with Sphinx")
7282

7383
# Nice named target so we can run the job easily
74-
add_custom_target(Sphinx ALL DEPENDS ${SPHINX_INDEX_FILE})
84+
add_custom_target(docs ALL
85+
DEPENDS ${SPHINX_INDEX_FILE})
7586

7687
# Add an install target to install the docs
7788
install(DIRECTORY ${SPHINX_BUILD} DESTINATION ${CMAKE_INSTALL_DOCDIR})

docs/Doxyfile.in

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,6 @@ FILE_PATTERNS = *.c \
991991
*.cppm \
992992
*.c++ \
993993
*.c++m \
994-
*.java \
995994
*.ii \
996995
*.ixx \
997996
*.ipp \
@@ -1006,33 +1005,7 @@ FILE_PATTERNS = *.c \
10061005
*.hpp \
10071006
*.h++ \
10081007
*.ixx \
1009-
*.l \
1010-
*.cs \
1011-
*.d \
1012-
*.php \
1013-
*.php4 \
1014-
*.php5 \
1015-
*.phtml \
1016-
*.inc \
1017-
*.m \
1018-
*.markdown \
1019-
*.md \
1020-
*.mm \
1021-
*.dox \
1022-
*.py \
1023-
*.pyw \
1024-
*.f90 \
1025-
*.f95 \
1026-
*.f03 \
1027-
*.f08 \
1028-
*.f18 \
1029-
*.f \
1030-
*.for \
1031-
*.vhd \
1032-
*.vhdl \
1033-
*.ucf \
1034-
*.qsf \
1035-
*.ice
1008+
*.inc
10361009

10371010
# The RECURSIVE tag can be used to specify whether or not subdirectories should
10381011
# be searched for input files as well.
@@ -1047,7 +1020,7 @@ RECURSIVE = YES
10471020
# Note that relative paths are relative to the directory from which doxygen is
10481021
# run.
10491022

1050-
EXCLUDE =
1023+
EXCLUDE = "@DOXYGEN_EXCLUDE_DIR@"
10511024

10521025
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
10531026
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -1072,7 +1045,8 @@ EXCLUDE_PATTERNS =
10721045
# ANamespace::AClass, ANamespace::*Test
10731046

10741047
EXCLUDE_SYMBOLS = *__* \
1075-
_*
1048+
*::_* \
1049+
std
10761050

10771051
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
10781052
# that contain example code fragments that are included (see the \include
@@ -2350,7 +2324,7 @@ ENABLE_PREPROCESSING = YES
23502324
# The default value is: NO.
23512325
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
23522326

2353-
MACRO_EXPANSION = NO
2327+
MACRO_EXPANSION = YES
23542328

23552329
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
23562330
# the macro expansion is limited to the macros specified with the PREDEFINED and
@@ -2391,7 +2365,18 @@ INCLUDE_FILE_PATTERNS =
23912365
# recursively expanded use the := operator instead of the = operator.
23922366
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
23932367

2394-
PREDEFINED = STDEXEC_DOXYGEN_INVOKED
2368+
PREDEFINED = __cplusplus=202302L \
2369+
STDEXEC_DOXYGEN_INVOKED=1 \
2370+
"STDEXEC_SYSTEM_CONTEXT_HEADER_ONLY=1" \
2371+
"STDEXEC_SYSTEM_CONTEXT_INLINE=inline" \
2372+
"STDEXEC_ATTRIBUTE(X)= " \
2373+
"STDEXEC_AUTO_RETURN(...)=->decltype(auto){ return __VA_ARGS__; }" \
2374+
"STDEXEC_MEMFN_DECL(...)=__VA_ARGS__" \
2375+
"STDEXEC_CLANG()=1" \
2376+
"STDEXEC_MSVC()=0" \
2377+
"STDEXEC_GCC()=0" \
2378+
"STDEXEC_NVHPC()=0" \
2379+
"STDEXEC_EDG()=0"
23952380

23962381
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
23972382
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2821,3 +2806,11 @@ MSCGEN_TOOL =
28212806
# command).
28222807

28232808
MSCFILE_DIRS =
2809+
2810+
# Use clang to parse the source code.
2811+
CLANG_ASSISTED_PARSING = YES
2812+
CLANG_DATABASE_PATH = "@COMPILATION_DB_PATH@"
2813+
CLANG_OPTIONS = -isystem "@STDDEF_INCLUDE_PATH@" \
2814+
-std=c++23 \
2815+
-DSTDEXEC_DOXYGEN_INVOKED=1 \
2816+
-DSTDEXEC_SYSTEM_CONTEXT_HEADER_ONLY=1

include/exec/__detail/__system_context_default_impl_entry.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
#pragma once
1717

18-
// This file assumes STDEXEC_SYSTEM_CONTEXT_INLINE is defined before including it.
19-
// But clang-tidy doesn't know that, so we need to include the header that defines
20-
// it when clang-tidy is invoked.
21-
#if defined(STDEXEC_CLANG_TIDY_INVOKED)
18+
// This file assumes STDEXEC_SYSTEM_CONTEXT_INLINE is defined before including it. But clang-tidy
19+
// and doxygen don't know that, so we need to include the header that defines it when clang-tidy and
20+
// doxygen are invoked.
21+
#if defined(STDEXEC_CLANG_TIDY_INVOKED) || defined(STDEXEC_DOXYGEN_INVOKED)
2222
# include "../system_context.hpp" // IWYU pragma: keep
2323
#endif
2424

include/stdexec/__detail/__meta.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,9 @@ namespace stdexec {
729729
_Cp<_Cs...> * = nullptr,
730730
_Dp<_Ds...> * = nullptr,
731731
_Tail *...__tail)
732-
-> decltype(__mconcat_<(sizeof...(_Tail) == 0)>::__f(
732+
-> __midentity<decltype(__mconcat_<(sizeof...(_Tail) == 0)>::__f(
733733
static_cast<__types<_Ts..., _As..., _Bs..., _Cs..., _Ds...> *>(nullptr),
734-
__tail...));
734+
__tail...))>;
735735
};
736736

737737
template <>

include/stdexec/__detail/__variant.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <cstddef>
2323
#include <memory>
2424
#include <new>
25+
#include <utility>
2526

2627
/********************************************************************************/
2728
/* NB: The variant type implemented here default-constructs into the valueless */

0 commit comments

Comments
 (0)