zig-datetime/build.zig

45 lines
1.1 KiB
Zig
Raw Normal View History

2023-10-14 12:39:16 -05:00
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
2023-10-14 13:56:43 -05:00
// var module = b.createModule(
// .{
// .source_file = .{
// .path = "src/main.zig",
// },
// },
// );
// try b.modules.put(b.dupe("datetime"), module);
2023-10-14 14:22:01 -05:00
_ = b.addModule(
2023-10-14 13:56:43 -05:00
"datetime",
2023-10-14 13:04:34 -05:00
.{
.source_file = .{
.path = "src/main.zig",
},
},
);
2023-10-14 16:18:33 -05:00
2023-10-14 12:39:16 -05:00
const lib = b.addStaticLibrary(.{
2023-10-14 12:53:43 -05:00
.name = "datetime",
2023-10-14 12:39:16 -05:00
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
b.installArtifact(lib);
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
const run_main_tests = b.addRunArtifact(main_tests);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_main_tests.step);
}