-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.zig
33 lines (30 loc) · 1.16 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
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const enable_freetype = b.option(bool, "enable_freetype", "Build Freetype") orelse true;
const use_system_zlib = b.option(bool, "freetype_use_system_zlib", "Use system zlib") orelse false;
const enable_brotli = b.option(bool, "freetype_enable_brotli", "Build brotli") orelse true;
const lib = b.addStaticLibrary(.{
.name = "harfbuzz",
.target = target,
.optimize = optimize,
});
lib.addCSourceFile(.{ .file = b.path("src/harfbuzz.cc") });
lib.linkLibCpp();
lib.installHeadersDirectory(b.path("src"), "harfbuzz", .{
.exclude_extensions = &.{".cc"},
});
if (enable_freetype) {
lib.root_module.addCMacro("HAVE_FREETYPE", "1");
if (b.lazyDependency("freetype", .{
.target = target,
.optimize = optimize,
.use_system_zlib = use_system_zlib,
.enable_brotli = enable_brotli,
})) |dep| {
lib.linkLibrary(dep.artifact("freetype"));
}
}
b.installArtifact(lib);
}