mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 15:42:49 +00:00
4c6f1e614a
init-lib creates a working static library with tests, and init-exe creates a working hello world with a `run` target. both now have test coverage with the new "cli tests" file. closes #1035
17 lines
467 B
Zig
17 lines
467 B
Zig
const Builder = @import("std").build.Builder;
|
|
|
|
pub fn build(b: *Builder) void {
|
|
const mode = b.standardReleaseOptions();
|
|
const lib = b.addStaticLibrary("$", "src/main.zig");
|
|
lib.setBuildMode(mode);
|
|
|
|
var main_tests = b.addTest("src/main.zig");
|
|
main_tests.setBuildMode(mode);
|
|
|
|
const test_step = b.step("test", "Run library tests");
|
|
test_step.dependOn(&main_tests.step);
|
|
|
|
b.default_step.dependOn(&lib.step);
|
|
b.installArtifact(lib);
|
|
}
|