-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.zig
44 lines (43 loc) · 1.09 KB
/
build.zig
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
const std = @import("std");
pub fn build(b: *std.Build) void {
const upstream = b.dependency("zlib", .{});
const lib = b.addStaticLibrary(.{
.name = "z",
.target = b.standardTargetOptions(.{}),
.optimize = b.standardOptimizeOption(.{}),
});
lib.linkLibC();
lib.addCSourceFiles(.{
.root = upstream.path(""),
.files = &.{
"adler32.c",
"crc32.c",
"deflate.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"zutil.c",
"compress.c",
"uncompr.c",
"gzclose.c",
"gzlib.c",
"gzread.c",
"gzwrite.c",
},
.flags = &.{
"-DHAVE_SYS_TYPES_H",
"-DHAVE_STDINT_H",
"-DHAVE_STDDEF_H",
"-DZ_HAVE_UNISTD_H",
},
});
lib.installHeadersDirectory(upstream.path(""), "", .{
.include_extensions = &.{
"zconf.h",
"zlib.h",
},
});
b.installArtifact(lib);
}