2023-02-18 06:28:47 +00:00
|
|
|
const std = @import("std");
|
|
|
|
|
|
|
|
pub fn build(b: *std.Build) void {
|
2023-03-08 07:16:16 +00:00
|
|
|
const test_step = b.step("test", "Test it");
|
|
|
|
b.default_step = test_step;
|
|
|
|
|
|
|
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
2023-02-18 06:28:47 +00:00
|
|
|
|
|
|
|
const foo = b.createModule(.{
|
|
|
|
.source_file = .{ .path = "foo.zig" },
|
|
|
|
});
|
|
|
|
foo.dependencies.put("foo", foo) catch @panic("OOM");
|
|
|
|
|
|
|
|
const exe = b.addExecutable(.{
|
|
|
|
.name = "test",
|
|
|
|
.root_source_file = .{ .path = "test.zig" },
|
|
|
|
.optimize = optimize,
|
|
|
|
});
|
|
|
|
exe.addModule("foo", foo);
|
|
|
|
|
2023-04-11 01:05:09 +01:00
|
|
|
const run = b.addRunArtifact(exe);
|
2023-02-18 06:28:47 +00:00
|
|
|
test_step.dependOn(&run.step);
|
|
|
|
}
|