Add doxygen support for the documentation

This commit is contained in:
Sameer Rahmani 2021-04-05 17:51:09 +01:00
parent 9ff707c726
commit 062b24e701
4 changed files with 42 additions and 16 deletions

View File

@ -53,15 +53,6 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# main CMakeLists.
include(CTest)
# Docs only available if this is the main app
find_package(Doxygen)
if(Doxygen_FOUND)
add_subdirectory(docs)
else()
message(STATUS "Doxygen not found, not building docs")
endif()
include(cotire)
include(FetchContent)
@ -120,5 +111,19 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(tests)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
# Docs only available if this is the main app
find_package(Doxygen
REQUIRED dot
OPTIONAL_COMPONENTS dia)
if(Doxygen_FOUND)
add_subdirectory(docs)
else()
message(STATUS "Doxygen not found, not building docs")
endif()
endif()
endif()

15
builder
View File

@ -41,6 +41,13 @@ function build-release() {
popd_build
}
function build-docs() {
pushed_build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Docs $ROOT_DIR
ninja -j `nproc`
popd_build
}
function clean() {
rm -rf $BUILD_DIR
}
@ -81,10 +88,16 @@ case "$command" in
mkdir -p $BUILD_DIR
build "${@:2}"
;;
"build-docs")
clean
mkdir -p $BUILD_DIR
build-docs "${@:2}"
;;
"build-release")
clean
mkdir -p $BUILD_DIR
build "${@:2}"
build-release "${@:2}"
;;
"compile")
compile

View File

@ -1,7 +1,16 @@
set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_GENERATE_MAN YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_PROJECT_BRIEF "Just another Lisp")
message("<<<<<<<<<<<<<<<<<<<<<<<<<<<")
message(${PROJECT_SOURCE_DIR})
message(${INCLUDE_DIR})
doxygen_add_docs(docs
serene/serene.hpp
"${CMAKE_CURRENT_SOURCE_DIR}/index.md"
WORKING_DIRECTORY
"${INCLUDE_DIR}")
#"${CMAKE_CURRENT_SOURCE_DIR}/index.md"
"${PROJECT_SOURCE_DIR}/src/"
${INCLUDE_DIR})
add_dependencies(serenec docs)

View File

@ -41,8 +41,7 @@ namespace sir {
mlir::ModuleOp Generator::generate() {
for (auto x : ns->Tree()) {
auto _ = generate(x.get());
UNUSED(_);
generate(x.get());
}
return module;