Files
Zigmulator/build.zig
T
2026-05-21 21:49:14 +02:00

31 lines
850 B
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const zigmulator = b.addModule("zigmulator", .{
.root_source_file = b.path("src/simulator.zig"),
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{
.name = "example",
.root_module = b.createModule(.{
.root_source_file = b.path("examples/example.zig"),
.target = target,
.optimize = optimize,
}),
});
exe.root_module.addImport("zigmulator", zigmulator);
const run_cmd = b.addRunArtifact(exe);
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the example");
run_step.dependOn(&run_cmd.step);
}