zig-chrono/build.zig

27 lines
848 B
Zig
Raw Normal View History

2023-06-12 22:59:12 -04:00
const std = @import("std");
2023-09-10 18:30:09 -04:00
pub fn build(b: *std.Build) void {
2023-06-12 22:59:12 -04:00
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
2023-09-10 18:30:09 -04:00
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
2023-06-12 22:59:12 -04:00
2023-09-10 18:30:09 -04:00
const lib = b.addStaticLibrary(.{
.name = "chrono",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
b.installArtifact(lib);
2023-06-12 22:59:12 -04:00
2023-09-10 18:30:09 -04:00
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/tests.zig" },
.target = target,
.optimize = optimize,
});
const run_main_tests = b.addRunArtifact(main_tests);
2023-06-12 22:59:12 -04:00
const test_step = b.step("test", "Run library tests");
2023-09-10 18:30:09 -04:00
test_step.dependOn(&run_main_tests.step);
2023-06-12 22:59:12 -04:00
}