Skip to content

Commit f117be1

Browse files
authored
vulkan: check glslc executable string (#17144)
1 parent 85234a4 commit f117be1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <algorithm>
1919
#include <sys/stat.h>
2020
#include <sys/types.h>
21+
#include <filesystem>
2122

2223
#ifdef _WIN32
2324
#define NOMINMAX
@@ -1080,6 +1081,11 @@ int main(int argc, char** argv) {
10801081

10811082
if (args.find("--glslc") != args.end()) {
10821083
GLSLC = args["--glslc"]; // Path to glslc
1084+
1085+
if (!std::filesystem::exists(GLSLC) || !std::filesystem::is_regular_file(GLSLC)) {
1086+
std::cerr << "Error: glslc not found at " << GLSLC << std::endl;
1087+
return EXIT_FAILURE;
1088+
}
10831089
}
10841090
if (args.find("--source") != args.end()) {
10851091
input_filepath = args["--source"]; // The shader source file to compile

0 commit comments

Comments
 (0)