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("noise", .{
8 .root_source_file = b.path("src/root.zig"),
9 .target = target,
10 .optimize = optimize,
11 });
12
13 const tests = b.addTest(.{ .root_module = mod });
14 const run_tests = b.addRunArtifact(tests);
15
16 const test_step = b.step("test", "run unit tests");
17 test_step.dependOn(&run_tests.step);
18
19 // example executable
20 const example = b.addExecutable(.{
21 .name = "example",
22 .root_module = b.createModule(.{
23 .root_source_file = b.path("src/example.zig"),
24 .target = target,
25 .optimize = optimize,
26 .imports = &.{.{ .name = "noise", .module = mod }},
27 }),
28 });
29 b.installArtifact(example);
30
31 const run_example = b.addRunArtifact(example);
32 const run_step = b.step("run", "run example");
33 run_step.dependOn(&run_example.step);
34
35 // ambient composition
36 const ambient = b.addExecutable(.{
37 .name = "ambient",
38 .root_module = b.createModule(.{
39 .root_source_file = b.path("src/ambient.zig"),
40 .target = target,
41 .optimize = optimize,
42 .imports = &.{.{ .name = "noise", .module = mod }},
43 }),
44 });
45 b.installArtifact(ambient);
46
47 const run_ambient = b.addRunArtifact(ambient);
48 const ambient_step = b.step("ambient", "generate ambient piece");
49 ambient_step.dependOn(&run_ambient.step);
50}