From 51af499d1db120969e874a4c2039eddd2ac2c8ee Mon Sep 17 00:00:00 2001 From: Alexandru Radovici Date: Sun, 23 Oct 2022 19:33:33 +0000 Subject: [PATCH] verify that libclang is present --- scripts/rust_is_available.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index aebbf19139709d..3237f10d0f82ec 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -106,6 +106,17 @@ bindgen_libclang_version=$( \ | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \ | head -n 1 \ ) + +# Check that libclang is present. +if [ -z $bindgen_libclang_version ]; then + if [ "$1" = -v ]; then + echo >&2 "***" + echo >&2 "*** libclang (used by the Rust bindings generator '$BINDGEN') does not seem to be present." + echo >&2 "***" + fi + exit 1 +fi + bindgen_libclang_min_version=$($min_tool_version llvm) bindgen_libclang_cversion=$(get_canonical_version $bindgen_libclang_version) bindgen_libclang_min_cversion=$(get_canonical_version $bindgen_libclang_min_version)