Skip to content

Commit 5db44fa

Browse files
committed
use a simple step instead of a compile step
1 parent 8f207a7 commit 5db44fa

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

build.zig

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,22 @@ pub fn build(b: *std.Build) void {
164164
_ = options;
165165
const run = Step.cast(step, Step.Run).?;
166166
const bin_path = run.cwd.?.getPath3(step.owner, step);
167-
168-
std.debug.print("bin_path is {s}\n", .{bin_path.sub_path});
169167
}
170168

171-
fn create_testdb(owner: *std.Build) *Step {
172-
const run = Step.Compile.create(owner, .{
169+
fn create_testdb(owner: *Build) *Step {
170+
var step = Step.init(.{
171+
.id = .custom,
172+
.owner = owner,
173+
.makeFn = make,
173174
.name = "Create testdb for test",
174-
.root_module = .{},
175-
.kind = .exe,
176175
});
177-
var step = &run.step;
178-
step.makeFn = make;
179-
return step;
176+
return &step;
180177
}
181178
}.create_testdb;
182179

183180
for (lmdb_test) |test_file| {
184181
const test_name = test_file[0..mem.indexOfScalar(u8, test_file, '.').?];
182+
185183
const test_exe = b.addExecutable(.{
186184
.name = test_name,
187185
.target = target,
@@ -211,7 +209,6 @@ pub fn build(b: *std.Build) void {
211209

212210
const create_testdb_step = run_create_testdb(run.step.owner);
213211
run.step.dependOn(create_testdb_step);
214-
215212
test_step.dependOn(&run.step);
216213
}
217214

0 commit comments

Comments
 (0)