mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 17:12:31 +00:00
23 lines
561 B
Zig
23 lines
561 B
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const foo = b.createModule(.{
|
|
.source_file = .{ .path = "foo.zig" },
|
|
});
|
|
foo.dependencies.put("foo", foo) catch @panic("OOM");
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "test",
|
|
.root_source_file = .{ .path = "test.zig" },
|
|
.optimize = optimize,
|
|
});
|
|
exe.addModule("foo", foo);
|
|
|
|
const run = exe.run();
|
|
|
|
const test_step = b.step("test", "Test it");
|
|
test_step.dependOn(&run.step);
|
|
}
|