-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.zig
More file actions
39 lines (33 loc) · 1.24 KB
/
build.zig
File metadata and controls
39 lines (33 loc) · 1.24 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
const std = @import("std");
const libxml2 = @import("libxml2.zig");
const zlib = @import("test/zig-zlib/zlib.zig");
pub fn build(b: *std.build.Builder) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const xml2 = try libxml2.create(b, target, optimize, .{
// We don't have the required libs so don't build these
.iconv = false,
.lzma = false,
.zlib = false,
});
b.installArtifact(xml2.step);
// Tests that we can depend on other libraries like zlib
const xml2_with_libs = try libxml2.create(b, target, optimize, .{
// We don't have the required libs so don't build these
.iconv = false,
.lzma = false,
// Testing this
.zlib = true,
});
// todo: uncomment when zig-zlib is updated
// const z = zlib.create(b, target, optimize);
// z.link(xml2_with_libs.step, .{});
const static_binding_test = b.addTest(.{
.root_source_file = .{ .path = "test/basic.zig" },
.optimize = optimize,
});
xml2.link(static_binding_test);
const test_step = b.step("test", "Run tests");
test_step.dependOn(&xml2_with_libs.step.step);
test_step.dependOn(&static_binding_test.step);
}