const std = @import("std"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const mod = b.addModule("noise", .{ .root_source_file = b.path("src/root.zig"), .target = target, .optimize = optimize, }); const tests = b.addTest(.{ .root_module = mod }); const run_tests = b.addRunArtifact(tests); const test_step = b.step("test", "run unit tests"); test_step.dependOn(&run_tests.step); // example executable const example = b.addExecutable(.{ .name = "example", .root_module = b.createModule(.{ .root_source_file = b.path("src/example.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "noise", .module = mod }}, }), }); b.installArtifact(example); const run_example = b.addRunArtifact(example); const run_step = b.step("run", "run example"); run_step.dependOn(&run_example.step); // ambient composition const ambient = b.addExecutable(.{ .name = "ambient", .root_module = b.createModule(.{ .root_source_file = b.path("src/ambient.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "noise", .module = mod }}, }), }); b.installArtifact(ambient); const run_ambient = b.addRunArtifact(ambient); const ambient_step = b.step("ambient", "generate ambient piece"); ambient_step.dependOn(&run_ambient.step); }