Skip to content

Commit 6e42e67

Browse files
committed
attempt to fall back to system glslc
1 parent 5edbacd commit 6e42e67

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,21 @@ ifeq ($(OS),Windows_NT)
674674
@echo 'Vulkan Shaders Rebuilt for Windows...'
675675
else
676676
@echo 'Now rebuilding vulkan shaders for Linux...'
677-
${shell} chmod +x vulkan-shaders-gen
678-
${shell} chmod +x glslc-linux
679-
$(shell) ./vulkan-shaders-gen --glslc ./glslc-linux --input-dir ggml/src/ggml-vulkan/vulkan-shaders --target-hpp ggml/src/ggml-vulkan-shaders.hpp --target-cpp ggml/src/ggml-vulkan-shaders.cpp
677+
@chmod +x vulkan-shaders-gen glslc-linux
678+
@echo 'Checking if bundled glslc-linux binary is usable...'
679+
@GLSLC_BIN=$$(if ./glslc-linux --version >/dev/null 2>&1; then \
680+
echo "./glslc-linux"; \
681+
elif command -v glslc >/dev/null 2>&1; then \
682+
echo "glslc"; \
683+
else \
684+
echo ""; \
685+
fi); \
686+
if [ -z "$$GLSLC_BIN" ]; then \
687+
echo "Error: No usable glslc found. Vulkan shaders cannot be compiled!"; \
688+
else \
689+
echo "Using GLSLC: $$GLSLC_BIN"; \
690+
./vulkan-shaders-gen --glslc "$$GLSLC_BIN" --input-dir ggml/src/ggml-vulkan/vulkan-shaders --target-hpp ggml/src/ggml-vulkan-shaders.hpp --target-cpp ggml/src/ggml-vulkan-shaders.cpp; \
691+
fi
680692
@echo 'Vulkan Shaders Rebuilt for Linux...'
681693
endif
682694

0 commit comments

Comments
 (0)