crasa-transport/build.zig

49 lines
1.5 KiB
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const zargs_dep = b.dependency("zargs", .{
.target = target,
.optimize = optimize,
});
const zargs_mod = zargs_dep.module("zargs");
const mod = b.addModule("crasa-transport", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
});
const tests = b.addTest(.{ .root_module = mod });
const testStep = b.step("test", "runs tests associated with the crasa-transportprotocol");
testStep.dependOn(&tests.step);
const server_mod = b.createModule(.{
.root_source_file = b.path("test/server.zig"),
.target = target,
.optimize = optimize,
});
server_mod.addImport("crasa-transport", mod);
server_mod.addImport("zargs", zargs_mod);
const server_exe = b.addExecutable(.{
.name = "test-server",
.root_module = server_mod,
});
b.installArtifact(server_exe);
const client_mod = b.createModule(.{
.root_source_file = b.path("test/client.zig"),
.target = target,
.optimize = optimize,
});
client_mod.addImport("crasa-transport", mod);
client_mod.addImport("zargs", zargs_mod);
const client_exe = b.addExecutable(.{
.name = "test-client",
.root_module = client_mod,
});
b.installArtifact(client_exe);
}