master
1const std = @import("std");
2
3pub fn build(b: *std.Build) void {
4 const test_step = b.step("test", "Test it");
5 b.default_step = test_step;
6
7 const optimize: std.builtin.OptimizeMode = .Debug;
8
9 const main_mod = b.createModule(.{
10 .root_source_file = b.path("test.zig"),
11 .target = b.graph.host,
12 .optimize = optimize,
13 });
14 const foo_mod = b.createModule(.{
15 .root_source_file = b.path("foo.zig"),
16 });
17
18 main_mod.addImport("foo", foo_mod);
19
20 const exe = b.addExecutable(.{
21 .name = "test",
22 .root_module = main_mod,
23 });
24
25 const run = b.addRunArtifact(exe);
26 test_step.dependOn(&run.step);
27}