Add build.zig to build an example
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user