Skip to content

Commit 8e22d30

Browse files
committed
Properly parse Fedora's clang version string
1 parent a7ad891 commit 8e22d30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

genbindings.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ if [ "$HOST_OSX" = "true" ]; then
429429
fi
430430
fi
431431
else
432-
CLANG_LLVM_V=$(clang --version | head -n1 | awk '{ print substr($4, 0, 2); }')
432+
# Output is something like clang version 17.0.3 (Fedora 17.0.3-1.fc39) or Debian clang version 14.0.6
433+
CLANG_LLVM_V=$(clang --version | head -n1 | awk '{ print substr($3, 0, 2); }')
434+
[ "$CLANG_LLVM_V" = "ve" ] && CLANG_LLVM_V=$(clang --version | head -n1 | awk '{ print substr($4, 0, 2); }')
433435
if [ -x "$(which ld.lld)" ]; then
434436
LLD_LLVM_V="$(ld.lld --version | awk '{ print $2; }')"
435437
if [ "$LLD_LLVM_V" = "LLD" ]; then # eg if the output is "Debian LLD ..."

0 commit comments

Comments
 (0)