[mlir] Bootstrap doxygen config

Add basic doxygen config following clang and llvm example with minimal
changes.
This commit is contained in:
Jacques Pienaar 2020-01-25 09:17:31 -08:00
parent 0f34ea5dc3
commit e298e21650
4 changed files with 2418 additions and 0 deletions

View File

@ -60,6 +60,12 @@ if( LLVM_INCLUDE_EXAMPLES )
add_subdirectory(examples)
endif()
option(MLIR_INCLUDE_DOCS "Generate build targets for the MLIR docs."
${LLVM_INCLUDE_DOCS})
if (MLIR_INCLUDE_DOCS)
add_subdirectory(docs)
endif()
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(DIRECTORY include/mlir include/mlir-c
DESTINATION include

103
mlir/docs/CMakeLists.txt Normal file
View File

@ -0,0 +1,103 @@
if (DOXYGEN_FOUND)
if (LLVM_ENABLE_DOXYGEN)
set(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
set(abs_top_builddir ${CMAKE_CURRENT_BINARY_DIR})
if (HAVE_DOT)
set(DOT ${LLVM_PATH_DOT})
endif()
if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
set(enable_searchengine "YES")
set(searchengine_url "${LLVM_DOXYGEN_SEARCHENGINE_URL}")
set(enable_server_based_search "YES")
set(enable_external_search "YES")
set(extra_search_mappings "${LLVM_DOXYGEN_SEARCH_MAPPINGS}")
else()
set(enable_searchengine "NO")
set(searchengine_url "")
set(enable_server_based_search "NO")
set(enable_external_search "NO")
set(extra_search_mappings "")
endif()
# If asked, configure doxygen for the creation of a Qt Compressed Help file.
if (LLVM_ENABLE_DOXYGEN_QT_HELP)
set(MLIR_DOXYGEN_QCH_FILENAME "org.llvm.mlir.qch" CACHE STRING
"Filename of the Qt Compressed help file")
set(MLIR_DOXYGEN_QHP_NAMESPACE "org.llvm.mlir" CACHE STRING
"Namespace under which the intermediate Qt Help Project file lives")
set(MLIR_DOXYGEN_QHP_CUST_FILTER_NAME "MLIR ${MLIR_VERSION}" CACHE STRING
"See http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters")
set(MLIR_DOXYGEN_QHP_CUST_FILTER_ATTRS "MLIR,${MLIR_VERSION}" CACHE STRING
"See http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes")
set(mlir_doxygen_generate_qhp "YES")
set(mlir_doxygen_qch_filename "${MLIR_DOXYGEN_QCH_FILENAME}")
set(mlir_doxygen_qhp_namespace "${MLIR_DOXYGEN_QHP_NAMESPACE}")
set(mlir_doxygen_qhelpgenerator_path "${LLVM_DOXYGEN_QHELPGENERATOR_PATH}")
set(mlir_doxygen_qhp_cust_filter_name "${MLIR_DOXYGEN_QHP_CUST_FILTER_NAME}")
set(mlir_doxygen_qhp_cust_filter_attrs "${MLIR_DOXYGEN_QHP_CUST_FILTER_ATTRS}")
else()
set(mlir_doxygen_generate_qhp "NO")
set(mlir_doxygen_qch_filename "")
set(mlir_doxygen_qhp_namespace "")
set(mlir_doxygen_qhelpgenerator_path "")
set(mlir_doxygen_qhp_cust_filter_name "")
set(mlir_doxygen_qhp_cust_filter_attrs "")
endif()
option(LLVM_DOXYGEN_SVG
"Use svg instead of png files for doxygen graphs." OFF)
if (LLVM_DOXYGEN_SVG)
set(DOT_IMAGE_FORMAT "svg")
else()
set(DOT_IMAGE_FORMAT "png")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
set(abs_top_srcdir)
set(abs_top_builddir)
set(DOT)
set(enable_searchengine)
set(searchengine_url)
set(enable_server_based_search)
set(enable_external_search)
set(extra_search_mappings)
set(mlir_doxygen_generate_qhp)
set(mlir_doxygen_qch_filename)
set(mlir_doxygen_qhp_namespace)
set(mlir_doxygen_qhelpgenerator_path)
set(mlir_doxygen_qhp_cust_filter_name)
set(mlir_doxygen_qhp_cust_filter_attrs)
set(DOT_IMAGE_FORMAT)
add_custom_target(doxygen-mlir
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating mlir doxygen documentation." VERBATIM)
if (LLVM_BUILD_DOCS)
add_dependencies(doxygen doxygen-mlir)
endif()
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
DESTINATION docs/html)
endif()
endif()
endif()
if (LLVM_ENABLE_SPHINX)
include(AddSphinxTarget)
if (SPHINX_FOUND)
if (${SPHINX_OUTPUT_HTML})
add_sphinx_target(html mlir)
endif()
if (${SPHINX_OUTPUT_MAN})
add_sphinx_target(man mlir)
endif()
endif()
endif()

View File

@ -0,0 +1,15 @@
/// \mainpage MLIR
///
/// \section main_intro Introduction
/// Welcome to the MLIR project.
///
/// This documentation describes the **internal** software that makes
/// up MLIR, not the **external** use of MLIR. There are no instructions
/// here on how to use MLIR, only the APIs that make up the software. For
/// usage instructions, please see the [project website](http://mlir.llvm.org)
/// for further detail.
///
/// \section main_caveat Caveat
/// This documentation is generated directly from the source code with doxygen.
/// Since MLIR is constantly under active development, what you're about to
/// read is out of date!

2294
mlir/docs/doxygen.cfg.in Normal file

File diff suppressed because it is too large Load Diff