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 const shared_mod = b.createModule(.{
18 .root_source_file = b.path("shared.zig"),
19 });
20
21 main_mod.addImport("foo", foo_mod);
22 main_mod.addImport("shared", shared_mod);
23 foo_mod.addImport("shared", shared_mod);
24
25 const exe = b.addExecutable(.{
26 .name = "test",
27 .root_module = main_mod,
28 });
29
30 const run = b.addRunArtifact(exe);
31 test_step.dependOn(&run.step);
32}