-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
79 lines (73 loc) · 1.88 KB
/
build.zig
File metadata and controls
79 lines (73 loc) · 1.88 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
77
78
79
const std = @import("std");
pub fn build(b: *std.Build) void {
const upstream = b.dependency("zfp", .{});
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const linkage = b.option(
std.builtin.LinkMode,
"linkage",
"Library linkage (default: static)",
) orelse .static;
const lib = b.addLibrary(.{
.name = "zfp",
.linkage = linkage,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.pic = true,
.link_libc = true,
.sanitize_c = .off,
}),
});
lib.linkLibC();
lib.addIncludePath(upstream.path("include"));
lib.addCSourceFiles(.{ .root = upstream.path("src"), .files = &.{
"bitstream.c",
"decode1d.c",
"decode1f.c",
"decode1i.c",
"decode1l.c",
"decode2d.c",
"decode2f.c",
"decode2i.c",
"decode2l.c",
"decode3d.c",
"decode3f.c",
"decode3i.c",
"decode3l.c",
"decode4d.c",
"decode4f.c",
"decode4i.c",
"decode4l.c",
"encode1d.c",
"encode1f.c",
"encode1i.c",
"encode1l.c",
"encode2d.c",
"encode2f.c",
"encode2i.c",
"encode2l.c",
"encode3d.c",
"encode3f.c",
"encode3i.c",
"encode3l.c",
"encode4d.c",
"encode4f.c",
"encode4i.c",
"encode4l.c",
"zfp.c",
}, .flags = &.{
"-fPIC",
"-std=c99",
} });
lib.installHeadersDirectory(upstream.path("include"), "", .{
.include_extensions = &.{
"zfp.h",
"zfp/bitstream.h",
"zfp/version.h",
"zfp/internal/zfp/system.h",
"zfp/internal/zfp/types.h",
},
});
b.installArtifact(lib);
}