[BUG] Building docs too aggressive with recursive folder searching
tmartin-gh opened this issue · 0 comments
tmartin-gh commented
Describe the Bug
Building the docs can fail on a dirty repo due to too aggressive recursive folder searching
To Reproduce
Here's one example from an otherwise clean repo
cd examples/cmake_sample_project
ln -s $matx_root MatX
mkdir build
cd build
cmake ..
make -j
cd ../../..
mkdir build_docs
cd build_docs
cmake -DMATX_BUILD_TESTS=OFF -DMATX_BUILD_BENCHMARKS=OFF -DMATX_BUILD_EXAMPLES=OFF -DMATX_BUILD_DOCS=ON ..
make
Results in
[ 33%] Generating documentation with Doxygen
$MatXRoot/examples/cmake_sample_project/build/_deps/cccl-src/libcudacxx/test/libcudacxx/std/iterators/iterator.range/begin-end.fail.cpp:57: error: More #endif's than #if's found. (warning treated as error, aborting now)
make[2]: *** [docs_input/CMakeFiles/Doxygen.dir/build.make:248: docs_input/doxygen/html/index.html] Error 1
make[1]: *** [CMakeFiles/Makefile2:136: docs_input/CMakeFiles/Doxygen.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Expected Behavior
Expected behavior is the docs should build without any errors.
Code Snippets
I haven't fully triaged the problem, but I believe it's related to docs_input/Doxyfile.in
EXCLUDE_PATTERNS = "@DOXYGEN_EXCLUDE_DIR@"
EXCLUDE_PATTERNS += "@DOXYGEN_EXCLUDE_DIR2@"
EXCLUDE_PATTERNS += "@DOXYGEN_EXCLUDE_DIR3@"
...
EXAMPLE_PATH = "@DOXYGEN_EXAMPLE_DIR@"
EXAMPLE_PATTERNS = *
and docs_input/CMakeLists.txt
set(DOXYGEN_EXAMPLE_DIR ${PROJECT_SOURCE_DIR}/examples)
set(DOXYGEN_EXCLUDE_DIR ${PROJECT_SOURCE_DIR}/third_party/*)
set(DOXYGEN_EXCLUDE_DIR2 ${PROJECT_BINARY_DIR}/*)
set(DOXYGEN_EXCLUDE_DIR3 ${PROJECT_SOURCE_DIR}/build*)
One potential hack is to add another exclude directory for examples/cmake_sample_project/build* but that wouldn't fix issues with build directories not named build*
or other non-clean files present.