Add build.zig to build an example

This commit is contained in:
2026-05-21 21:42:15 +02:00
parent 6f14bec123
commit 9d1759fb87
3 changed files with 25 additions and 54 deletions
+24
View File
@@ -0,0 +1,24 @@
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);
b.installArtifact(exe);
}