Skip to content

PS2 games in the browser: static recompilation to WebAssembly with a native runtime

C++

scripts/cxx.sh: survive hosts with no versioned clang++ under pipefail

Riccardo Giorato5fdb9d2214f2
diff --git a/scripts/cxx.sh b/scripts/cxx.sh
index 2286bdb..95ae7be 100644
--- a/scripts/cxx.sh
+++ b/scripts/cxx.sh
@@ -6,7 +6,7 @@ cxx_probe=$(mktemp -d)
printf '#include <format>\nint main() { return std::format("{}", 1).size() != 1; }\n' > "$cxx_probe/t.cpp"
cxx_candidates=()
[ -n "${CXX:-}" ] && cxx_candidates+=("$CXX")
-cxx_candidates+=($(compgen -c clang++- | grep -E '^clang\+\+-[0-9]+$' | sort -t- -k2 -rn | uniq) clang++ g++)
+cxx_candidates+=($(compgen -c clang++- | grep -E '^clang\+\+-[0-9]+$' | sort -t- -k2 -rn | uniq || true) clang++ g++)
for cxx in "${cxx_candidates[@]}"; do
command -v "$cxx" > /dev/null || continue
for stdlib in "" -stdlib=libc++; do