2025-01-08 23:14:17 +01:00
|
|
|
const std = @import("std");
|
|
|
|
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
|
|
const target = b.standardTargetOptions(.{});
|
|
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
|
2025-04-12 12:39:15 +02:00
|
|
|
// Add anyascii dependency.
|
|
|
|
const anyascii = b.dependency("anyascii", .{
|
2025-01-08 23:14:17 +01:00
|
|
|
.target = target,
|
|
|
|
.optimize = optimize,
|
|
|
|
});
|
|
|
|
|
|
|
|
// Zlugify zig module.
|
|
|
|
const zlugify = b.addModule("zlugify", .{
|
|
|
|
.root_source_file = b.path("src/lib.zig"),
|
|
|
|
.target = target,
|
|
|
|
.optimize = optimize,
|
|
|
|
});
|
2025-04-12 12:39:15 +02:00
|
|
|
// Add anyascii dependency.
|
2025-01-08 23:14:17 +01:00
|
|
|
zlugify.addImport("anyascii", anyascii.module("anyascii"));
|
|
|
|
|
|
|
|
// Library unit tests.
|
|
|
|
const lib_unit_tests = b.addTest(.{
|
2025-04-12 12:39:15 +02:00
|
|
|
.root_module = zlugify,
|
2025-01-08 23:14:17 +01:00
|
|
|
.target = target,
|
|
|
|
.optimize = optimize,
|
|
|
|
});
|
|
|
|
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
|
|
|
|
|
|
|
const test_step = b.step("test", "Run unit tests.");
|
|
|
|
test_step.dependOn(&run_lib_unit_tests.step);
|
|
|
|
}
|