pgzql/build.zig

34 lines
955 B
Zig
Raw Normal View History

2024-12-08 21:38:51 +01:00
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Initialize pgzql module.
const pgzql = b.addModule("pgzql", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
// Add tardy library.
const tardy = b.dependency("tardy", .{
.target = target,
.optimize = optimize,
});
pgzql.addImport("tardy", tardy.module("tardy"));
const lib_unit_tests = b.addTest(.{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
lib_unit_tests.root_module.addImport("pgzql", pgzql);
lib_unit_tests.root_module.addImport("tardy", tardy.module("tardy"));
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
run_lib_unit_tests.has_side_effects = true;
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_lib_unit_tests.step);
}