Skip to content

Commit

Permalink
gpu-dawn: add NO_ENSURE_SUBMODULES=true env var for development
Browse files Browse the repository at this point in the history
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 #86

Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
slimsag committed Feb 20, 2022
1 parent cfc3efb commit f5332b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gpu-dawn/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f5332b2

Please sign in to comment.