From 69b25513784ea71743ac955682f4603cf93f532b Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 20 Feb 2022 16:27:42 -0700 Subject: [PATCH] gpu-dawn: add NO_ENSURE_SUBMODULES=true env var for development If you're working on changes to source files in `gpu-dawn/libs/dawn/`, it's annoying to have the build system constantly reset your revision to the desired one. `NO_ENSURE_SUBMODULES=true` will now disable this behavior. Helps hexops/mach#86 Signed-off-by: Stephen Gutekanst --- gpu-dawn/build.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpu-dawn/build.zig b/gpu-dawn/build.zig index b800049b1e..70a43f0fe5 100644 --- a/gpu-dawn/build.zig +++ b/gpu-dawn/build.zig @@ -177,6 +177,9 @@ fn linkFromSource(b: *Builder, step: *std.build.LibExeObjStep, options: Options) } fn ensureSubmodules(allocator: std.mem.Allocator) !void { + if (std.process.getEnvVarOwned(allocator, "NO_ENSURE_SUBMODULES")) |no_ensure_submodules| { + if (std.mem.eql(u8, no_ensure_submodules, "true")) return; + } else |_| {} const child = try std.ChildProcess.init(&.{ "git", "submodule", "update", "--init", "--recursive" }, allocator); child.cwd = thisDir(); child.stderr = std.io.getStdErr();