From 288d5002f31955119bf1f8c15e16dc9506030ed1 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Mon, 16 Sep 2024 20:12:30 +0200 Subject: [PATCH] Add support for vendored spirv-reflect This allows build-archives.sh to fall back to vendored spirv-reflect if it can't be found in PATH. Also update error messages to suggest additional alternatives. Signed-off-by: Ralph Sennhauser --- source/tools/dist/build-archives.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/tools/dist/build-archives.sh b/source/tools/dist/build-archives.sh index 6d3fdd7955..66c06dd3f1 100755 --- a/source/tools/dist/build-archives.sh +++ b/source/tools/dist/build-archives.sh @@ -43,10 +43,18 @@ if [ "${BUILD_SHADERS}" = true ]; then PYTHON=${PYTHON:=$(command -v python3 || command -v python || true)} GLSLC=${GLSLC:=$(command -v glslc || true)} SPIRV_REFLECT=${SPIRV_REFLECT:=$(command -v spirv-reflect || true)} + if [ -e "$(realpath libraries/source/spirv-reflect/bin/spirv-reflect || true)" ]; then + : "${SPIRV_REFLECT:=$(realpath libraries/source/spirv-reflect/bin/spirv-reflect || true)}" + fi + export SPIRV_REFLECT [ -n "${PYTHON}" ] || die "Error: python is not available. Install it before proceeding." - [ -n "${GLSLC}" ] || die "Error: glslc is not available. Install it with the Vulkan SDK before proceeding." - [ -n "${SPIRV_REFLECT}" ] || die "Error: spirv-reflect is not available. Install it with the Vulkan SDK before proceeding." + [ -n "${GLSLC}" ] || + die "Error: glslc is not available." \ + " Install it with the Vulkan SDK or shaderc package before proceeding." + [ -n "${SPIRV_REFLECT}" ] || + die "Error: spirv-reflect is not available." \ + " Install it with the Vulkan SDK or build vendored spirv-reflect before proceeding." cd source/tools/spirv || die