Support LLVM_VERSION_SUFFIX in clang version parsing regex

If LLVM is compiled with the LLVM_VERSION_SUFFIX cmake option, then the
version may have an additional suffix, for example "18.1.7+libcxx".
Gentoo for example uses this to fend off ABI issues between libstdc++
and libc++.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
This commit is contained in:
Violet Purcell 2024-06-12 11:55:43 -04:00
parent 34075829a4
commit 2341b67971
No known key found for this signature in database
GPG Key ID: AC2885C07052B6AF

View File

@ -1,3 +1,3 @@
#!/bin/bash
"$1" --version | sed -nr 's/^.*clang version ([\.0-9]*)(git)?( .*)?$/\1/p'
"$1" --version | sed -nr 's/^.*clang version ([\.0-9]*)(git)?(\+.*)?( .*)?$/\1/p'