-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.zig
30 lines (23 loc) · 1.05 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const lib = b.addStaticLibrary("luf", "src/luf.zig");
lib.setBuildMode(mode);
lib.install();
var examples = b.addExecutable("example", "examples/example_runner.zig");
examples.setBuildMode(mode);
examples.addPackagePath("luf", "src/luf.zig");
const example_runner = examples.run();
const example = b.option([]const u8, "example", "The example to run (without .luf suffix)");
examples.addBuildOption(?[]const u8, "example", example);
const example_step = b.step("examples", "Runs an example using the -Dexample flag");
example_step.dependOn(&example_runner.step);
var main_tests = b.addTest("src/luf.zig");
main_tests.setBuildMode(mode);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&main_tests.step);
const cli = b.addExecutable("luf", "src/cli/main.zig");
cli.setBuildMode(mode);
cli.addPackagePath("luf", "src/luf.zig");
cli.install();
}