[llvm] build-docs: Add option to disable doxygen docs (PR #66928)

Tobias Hieta via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 09:41:29 PDT 2023


https://github.com/tru created https://github.com/llvm/llvm-project/pull/66928

Doxygen documentation takes very long to build, when making releases we
want to get the normal documentation up earlier so that we don't have to
wait for doxygen documentation.

This PR just adds the flag to disable doxygen builds, I will then later
make a PR that changes the actions to first build the normal docs and
another job to build the doxygen docs.


>From eaf68538d91057ca077494ed150dcf8f6ebf0a1c Mon Sep 17 00:00:00 2001
From: Tobias Hieta <tobias at hieta.se>
Date: Wed, 20 Sep 2023 18:39:11 +0200
Subject: [PATCH] build-docs: Add option to disable doxygen docs

Doxygen documentation takes very long to build, when making releases we
want to get the normal documentation up earlier so that we don't have to
wait for doxygen documentation.

This PR just adds the flag to disable doxygen builds, I will then later
make a PR that changes the actions to first build the normal docs and
another job to build the doxygen docs.
---
 llvm/utils/release/build-docs.sh | 46 +++++++++++++++++---------------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/llvm/utils/release/build-docs.sh b/llvm/utils/release/build-docs.sh
index ef3784959b4f3aa..517d91298888209 100755
--- a/llvm/utils/release/build-docs.sh
+++ b/llvm/utils/release/build-docs.sh
@@ -1,3 +1,4 @@
+
 #!/bin/bash
 #===-- build-docs.sh - Tag the LLVM release candidates ---------------------===#
 #
@@ -20,7 +21,7 @@
 #   * pip install sphinx-markdown-tables
 #===------------------------------------------------------------------------===#
 
-set -ex
+set -e
 
 builddir=docs-build
 srcdir=$(readlink -f $(dirname "$(readlink -f "$0")")/../..)
@@ -34,6 +35,7 @@ usage() {
   echo "                documentation from that source."
   echo " -srcdir  <dir> Path to llvm source directory with CMakeLists.txt"
   echo "                (optional) default: $srcdir"
+  echo " -no-doxygen    Don't build Doxygen docs"
 }
 
 package_doxygen() {
@@ -57,6 +59,9 @@ while [ $# -gt 0 ]; do
       shift
       custom_srcdir=$1
       ;;
+    -no-doxygen )
+      no_doxygen="yes"
+      ;;
     * )
       echo "unknown option: $1"
       usage
@@ -89,28 +94,25 @@ if [ -n "$release" ]; then
   srcdir="./llvm-project/llvm"
 fi
 
+docs_targets="docs-clang-html docs-clang-tools-html docs-flang-html docs-lld-html docs-llvm-html docs-polly-html"
+
+if [ "$no_doxygen" != "yes" ]; then
+  echo "Doxygen: enabled"
+  docs_targets="$docs_target doxygen-clang doxygen-clang-tools doxygen-flang doxygen-llvm doxygen-mlir doxygen-polly"
+  doxygen_flag=" -DLLVM_ENABLE_DOXYGEN=ON -DLLVM_DOXYGEN_SVG=ON"
+else
+   echo "Doxygen: disabled"
+fi
+
 cmake -G Ninja $srcdir -B $builddir \
                -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;polly;flang" \
                -DCMAKE_BUILD_TYPE=Release \
-               -DLLVM_ENABLE_DOXYGEN=ON \
                -DLLVM_ENABLE_SPHINX=ON \
                -DLLVM_BUILD_DOCS=ON \
-               -DLLVM_DOXYGEN_SVG=ON \
-               -DSPHINX_WARNINGS_AS_ERRORS=OFF
+               -DSPHINX_WARNINGS_AS_ERRORS=OFF \
+               $doxygen_flag
 
-ninja -C $builddir \
-               docs-clang-html \
-               docs-clang-tools-html \
-               docs-flang-html \
-               docs-lld-html \
-               docs-llvm-html \
-               docs-polly-html \
-               doxygen-clang \
-               doxygen-clang-tools \
-               doxygen-flang \
-               doxygen-llvm \
-               doxygen-mlir \
-               doxygen-polly
+ninja -C $builddir $docs_targets
 
 cmake -G Ninja $srcdir/../runtimes -B $builddir/runtimes-doc \
                -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
@@ -120,10 +122,12 @@ cmake -G Ninja $srcdir/../runtimes -B $builddir/runtimes-doc \
 ninja -C $builddir/runtimes-doc \
                docs-libcxx-html \
 
-package_doxygen llvm .
-package_doxygen clang tools/clang
-package_doxygen clang-tools-extra tools/clang/tools/extra
-package_doxygen flang tools/flang
+if [ "$no_doxygen" != "yes" ]; then
+  package_doxygen llvm .
+  package_doxygen clang tools/clang
+  package_doxygen clang-tools-extra tools/clang/tools/extra
+  package_doxygen flang tools/flang
+fi
 
 html_dir=$builddir/html-export/
 



More information about the llvm-commits mailing list