Skip to content

Commit

Permalink
use clang as a doxygen preprocessor and turn requires clauses into \p…
Browse files Browse the repository at this point in the history
…re blocks
  • Loading branch information
ericniebler committed Aug 6, 2020
1 parent 907a473 commit 385a813
Show file tree
Hide file tree
Showing 238 changed files with 3,647 additions and 2,352 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
ForEachMacros: ['RANGES_FOR',],
IncludeBlocks: Regroup,
IncludeCategories: [
{ Regex: '^<range/v3/detail/disable_warnings.hpp',
{ Regex: '^<range/v3/detail/prologue.hpp',
Priority: 8},
{ Regex: '^<range/v3/range_fwd.hpp',
Priority: 6},
Expand Down
1 change: 1 addition & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ endif()
set(CMAKE_FOLDER "doc")

configure_file(Doxyfile.in Doxyfile @ONLY)
configure_file(preprocess.sh.in preprocess.sh @ONLY)
add_custom_target(doc.check
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
COMMENT "Running Doxygen to validate the documentation"
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ EXAMPLE_PATH = @Range-v3_SOURCE_DIR@/example \
@Range-v3_SOURCE_DIR@/test
EXAMPLE_RECURSIVE = YES
IMAGE_PATH = @Range-v3_BINARY_DIR@/image
FILTER_PATTERNS = *.hpp="\"@Range-v3_BINARY_DIR@/doc/preprocess.sh\""
WARN_IF_UNDOCUMENTED = NO

SHOW_GROUPED_MEMB_INC = YES
Expand All @@ -86,7 +87,6 @@ INLINE_SIMPLE_STRUCTS = NO
GENERATE_HTML = YES
GENERATE_LATEX = NO


GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
Expand Down
3 changes: 3 additions & 0 deletions doc/ignore_errors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
$* 2>/dev/null
exit 0
3 changes: 3 additions & 0 deletions doc/preprocess.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
@Range-v3_SOURCE_DIR@/doc/ignore_errors.sh @CMAKE_CXX_COMPILER@ -x c++ -std=c++2a -DRANGES_DOXYGEN_INVOKED=1 -DMETA_DOXYGEN_INVOKED=1 -DCPP_DOXYGEN_INVOKED=1 -I @Range-v3_SOURCE_DIR@/include -E -CC $1 | @Range-v3_SOURCE_DIR@/doc/unpreprocess.pl
exit 0
19 changes: 19 additions & 0 deletions doc/unpreprocess.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/perl

use strict;

my $file = "";
my $first = 1;
my $emit = 0;

while(<>) {
if ($first) {
$_ =~ m/^#\s*\d+\s+"(.*)"/;
$file = $1;
$first = 0;
} elsif ($_ =~ m/^#\s*\d+\s+"(.*)"/) {
$emit = ($1 eq $file);
} elsif ($emit) {
print $_;
}
}
Loading

0 comments on commit 385a813

Please sign in to comment.