about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--scripts/build/v-llvm.inc19
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/build/v-llvm.inc b/scripts/build/v-llvm.inc
index 5ec6f713..9d84f6c2 100644
--- a/scripts/build/v-llvm.inc
+++ b/scripts/build/v-llvm.inc
@@ -22,7 +22,24 @@ export_variables_llvm=(
 artifact_dependency_llvm=("sanitizer")
 
 setup_variables_llvm() {
-  LLVM_VERSION_SHORT="${LLVM_VERSION/./}"
+  local v_a
+  v_a=(${LLVM_VERSION//./ })
+
+  LLVM_VERSION_MAJOR="0"
+  LLVM_VERSION_MINOR="0"
+  LLVM_VERSION_PATCH="0"
+
+  if [[ "${#v_a[@]}" -ge 1 ]]; then
+    LLVM_VERSION_MAJOR="${v_a[0]}"
+  fi
+  if [[ "${#v_a[@]}" -ge 2 ]]; then
+    LLVM_VERSION_MINOR="${v_a[1]}"
+  fi
+  if [[ "${#v_a[@]}" -ge 3 ]]; then
+    LLVM_VERSION_PATCH="${v_a[2]}"
+  fi
+
+  LLVM_VERSION_SHORT="${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}"
 }
 
 check_export_variables_llvm() {