-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.zig
More file actions
76 lines (65 loc) · 2.4 KB
/
Copy pathbuild.zig
File metadata and controls
76 lines (65 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const quarkz_dep = b.dependency("quarkz", .{
.target = target,
.optimize = optimize,
});
const lib = b.addStaticLibrary(.{
.name = "msquiczig",
.root_source_file = b.path("src/lib.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
});
b.installArtifact(lib);
const msquiczig = b.addModule("msquiczig", .{
.root_source_file = b.path("src/lib.zig"),
.imports = &.{
.{ .name = "quarkz", .module = quarkz_dep.module("quarkz") },
},
});
const server_example = b.addExecutable(.{
.name = "msquic-server",
.root_module = b.createModule(.{
.root_source_file = b.path("examples/server/main.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.imports = &.{
.{ .name = "quarkz", .module = quarkz_dep.module("quarkz") },
.{ .name = "msquiczig", .module = msquiczig },
},
}),
});
const client_example = b.addExecutable(.{
.name = "msquic-client",
.root_module = b.createModule(.{
.root_source_file = b.path("examples/client/main.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.imports = &.{
.{ .name = "quarkz", .module = quarkz_dep.module("quarkz") },
.{ .name = "msquiczig", .module = msquiczig },
},
}),
});
const run_server = b.addRunArtifact(server_example);
const run_server_step = b.step("run-server", "Run the server app");
run_server_step.dependOn(&run_server.step);
const run_client = b.addRunArtifact(client_example);
const run_client_step = b.step("run-client", "Run the client app");
run_client_step.dependOn(&run_client.step);
const tests = b.addTest(.{
.root_source_file = b.path("src/lib.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
});
tests.root_module.addImport("quarkz", quarkz_dep.module("quarkz"));
const run_tests = b.addRunArtifact(tests);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_tests.step);
}