Switch to Doxygen

clang-doc is nice and good, but there are features missing such as the ability to manually create a reference (link)...
This commit is contained in:
Simon Hausmann 2020-08-21 16:20:37 +02:00
parent 4d915227f7
commit 462d73ccdc
3 changed files with 2575 additions and 19 deletions

View file

@ -80,8 +80,8 @@ jobs:
with:
command: test
args: --verbose
- name: Install clang-doc
run: sudo apt-get install clang-tools-10 clang-10-doc
- name: Install doxygen
run: sudo apt-get install doxygen
- name: Prepare cmake module
run: cargo xtask cmake --prefix $HOME/sixtyfps_install --install
- name: C++ Test
@ -121,7 +121,7 @@ jobs:
rm -rf docs
mkdir -p docs
mkdir -p docs/cpp
cp -a ../target/debug/docs/* docs/cpp/
cp -a ../target/debug/docs/html/* docs/cpp/
git add docs
git add -u docs
git commit --message "Update $NAME from $GITHUB_REPOSITORY" --message "Pull web demos and C++ reference docs from commit $GITHUB_SHA ($GITHUB_REF)"

View file

@ -83,20 +83,8 @@ install(FILES
DESTINATION lib/cmake/SixtyFPS
)
if(APPLE)
execute_process(COMMAND brew --prefix llvm RESULT_VARIABLE prefix_status OUTPUT_VARIABLE llvm_prefix ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(prefix_status EQUAL "0")
set(clang_doc_hint "HINTS;${llvm_prefix}/bin")
endif()
endif()
find_program(clang_doc NAMES clang-doc clang-doc-10 ${clang_doc_hint})
if(clang_doc)
message(STATUS "Clang doc found at ${clang_doc}. Will build API documentation")
add_library(api_docs lib.cpp)
target_link_libraries(api_docs SixtyFPS)
add_custom_target(docs ALL COMMAND ${clang_doc} -p ${CMAKE_CURRENT_BINARY_DIR} --format=html --public --project-name "SixtyFPS C++" ${CMAKE_CURRENT_SOURCE_DIR}/lib.cpp)
else()
message(STATUS "Clang doc NOT found. Will NOT build API documentation")
add_custom_target(docs COMMAND ${CMAKE} -E echo "Not building documentation because clang-doc wasn't found in PATH")
find_package(Doxygen)
if (DOXYGEN_FOUND)
configure_file(Doxyfile.in Doxyfile)
add_custom_target(docs ALL COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
endif()

File diff suppressed because it is too large Load diff