Skip to content

Commit 825c6a5

Browse files
committed
use setCwd in create_testdb fn
1 parent fa790d8 commit 825c6a5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

build.zig

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ const builtin = @import("builtin");
33
const mem = std.mem;
44
const Build = std.Build;
55
const Step = Build.Step;
6-
const MakeOptions = if (@hasDecl(Step, "MakeOptions"))
7-
Step.MakeOptions
8-
else
9-
std.Progress.Node;
106

117
pub fn build(b: *Build) void {
128
if (comptime !checkVersion())
@@ -158,6 +154,11 @@ pub fn build(b: *Build) void {
158154
// "mtest6.c", // disabled as it requires building liblmdb with MDB_DEBUG
159155
};
160156

157+
const MakeOptions = if (@hasDecl(Step, "MakeOptions"))
158+
Step.MakeOptions
159+
else
160+
std.Progress.Node;
161+
161162
const test_step = b.step("test", "Run lmdb tests");
162163
const run_create_testdb = struct {
163164
fn makeFn(step: *Step, options: MakeOptions) !void {
@@ -180,10 +181,8 @@ pub fn build(b: *Build) void {
180181

181182
fn create_testdb(owner: *Build, test_dirname: Build.LazyPath) *Step {
182183
const run = Step.Run.create(owner, "create testdb at the generated path");
183-
run.cwd = test_dirname;
184184
run.step.makeFn = makeFn;
185-
186-
test_dirname.addStepDependencies(&run.step);
185+
run.setCwd(test_dirname);
187186

188187
return &run.step;
189188
}

0 commit comments

Comments
 (0)