From 2736b6fb8885950a8a6b14805b82227260fc6734 Mon Sep 17 00:00:00 2001 From: sdarwin Date: Wed, 10 Jul 2024 07:02:20 -0600 Subject: [PATCH] Docs: detect version of clang++ --- doc/build_antora.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/build_antora.sh b/doc/build_antora.sh index ddde61005..4f5aac80d 100644 --- a/doc/build_antora.sh +++ b/doc/build_antora.sh @@ -7,6 +7,21 @@ # Official repository: https://github.com/boostorg/url # +set -e + +# If CXX was not already set, then determine the newest clang. +if [ ! -n "$CXX" ]; then + for i in $(seq 40 -1 18); do + if [ -f /usr/bin/clang++-${i} ]; then + export CXX="/usr/bin/clang++-$i" + export CC="/usr/bin/clang-$i" + break + fi + done +fi + +set -x + if [ $# -eq 0 ] then echo "No playbook supplied, using default playbook" @@ -24,4 +39,3 @@ PATH="$(pwd)/node_modules/.bin:${PATH}" export PATH npx antora --clean --fetch "$PLAYBOOK" echo "Done" -