zig-zyrup/build.zig

49 lines
1.5 KiB
Zig
Raw Normal View History

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const opts = .{ .target = target, .optimize = optimize };
const getty_mod = b.dependency("getty", opts).module("getty");
const lib = b.addStaticLibrary(.{
.name = "zyrup",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
lib.addModule("getty", getty_mod);
b.installArtifact(lib);
2023-07-18 07:27:28 +00:00
const ser_tests = b.addTest(.{
.name = "serializer test",
.root_source_file = .{ .path = "src/ser.zig" },
.target = target,
.optimize = optimize,
});
ser_tests.addModule("getty", getty_mod);
ser_tests.addAnonymousModule("zoo.bin", .{ .source_file = std.Build.FileSource.relative("test-data/zoo.bin") });
const utf8_tests = b.addTest(.{
.name = "utf8 string test",
.root_source_file = .{ .path = "src/utf8_string.zig" },
.target = target,
.optimize = optimize,
});
2023-07-18 07:27:28 +00:00
const record_tests = b.addTest(.{
.name = "record test",
.root_source_file = .{ .path = "src/record.zig" },
.target = target,
.optimize = optimize,
});
const test_step = b.step("test", "Run library tests");
2023-07-18 07:27:28 +00:00
test_step.dependOn(&b.addRunArtifact(ser_tests).step);
test_step.dependOn(&b.addRunArtifact(utf8_tests).step);
test_step.dependOn(&b.addRunArtifact(record_tests).step);
}