this repo has no description
1const std = @import("std");
2
3pub fn build(b: *std.Build) void {
4 const target = b.standardTargetOptions(.{});
5 const optimize = b.standardOptimizeOption(.{});
6
7 const mod = b.addModule("aether", .{
8 .root_source_file = b.path("src/root.zig"),
9 .target = target,
10 });
11
12 const mod_exe = b.createModule(.{
13 .root_source_file = b.path("src/main.zig"),
14 .target = target,
15 .optimize = optimize,
16 .imports = &.{
17 .{ .name = "aether", .module = mod },
18 },
19 });
20
21 const exe = b.addExecutable(.{
22 .name = "aether",
23 .root_module = mod_exe,
24 });
25
26 b.installArtifact(exe);
27
28 const run_step = b.step("run", "Run the app");
29 const run_cmd = b.addRunArtifact(exe);
30 run_step.dependOn(&run_cmd.step);
31 run_cmd.step.dependOn(b.getInstallStep());
32
33 if (b.args) |args| {
34 run_cmd.addArgs(args);
35 }
36
37 const test_step = b.step("test", "Run tests");
38 addTest(b, test_step, mod, "aether");
39 addTest(b, test_step, mod_exe, "aether-exe");
40}
41
42fn addTest(b: *std.Build, step: *std.Build.Step, mod: *std.Build.Module, name: ?[]const u8) void {
43 const mod_tests = b.addTest(.{
44 .root_module = mod,
45 .name = if (name) |n| n else "test",
46 });
47 const run_mod_tests = b.addRunArtifact(mod_tests);
48 step.dependOn(&run_mod_tests.step);
49}