aboutsummaryrefslogtreecommitdiffstats
path: root/doc/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-10-05 12:26:41 -0400
committerDavid Robillard <d@drobilla.net>2024-10-05 12:26:41 -0400
commit0a2e26e998a64f981cc308249010173cebfa6ad2 (patch)
tree12c75f3609b4760fdb2ddd82eaca74a166d98a97 /doc/meson.build
parentdc2c434fdb4c77a7cd14e22d2624c0ee879ca029 (diff)
downloadpugl-0a2e26e998a64f981cc308249010173cebfa6ad2.tar.gz
pugl-0a2e26e998a64f981cc308249010173cebfa6ad2.tar.bz2
pugl-0a2e26e998a64f981cc308249010173cebfa6ad2.zip
Clean up documentation build and use unique target names
Diffstat (limited to 'doc/meson.build')
-rw-r--r--doc/meson.build18
1 files changed, 12 insertions, 6 deletions
diff --git a/doc/meson.build b/doc/meson.build
index e7a1763..6368f8a 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,19 +1,25 @@
-# Copyright 2021 David Robillard <d@drobilla.net>
+# Copyright 2021-2024 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR ISC
docdir = get_option('datadir') / 'doc'
+# Find required external programs
doxygen = find_program('doxygen', required: get_option('docs'))
-sphinxygen = find_program('sphinxygen', required: false)
sphinx_build = find_program('sphinx-build', required: get_option('docs'))
-if not sphinxygen.found()
- subproject('sphinxygen')
- sphinxygen = find_program('sphinxygen', required: get_option('docs'))
+# Find sphinxygen or fall back to subproject
+if doxygen.found() and sphinx_build.found()
+ sphinxygen = find_program('sphinxygen', required: false)
+ if not sphinxygen.found()
+ subproject('sphinxygen')
+ sphinxygen = find_program('sphinxygen', required: get_option('docs'))
+ endif
+else
+ sphinxygen = disabler()
endif
+# Build documentation if all required tools are found
build_docs = doxygen.found() and sphinxygen.found() and sphinx_build.found()
-
if build_docs
subdir('_static')
subdir('c')