Skip to content

Commit 034bf3b

Browse files
committed
linux, not well reviewed
1 parent 4bd30bc commit 034bf3b

4 files changed

Lines changed: 725 additions & 3 deletions

File tree

‎build.zig‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn build(b: *std.Build) void {
1010
.use_png = true,
1111
.use_glib = false,
1212
.use_dwrite = false,
13-
.use_fontconfig = false,
13+
.use_fontconfig = true,
1414
.use_freetype = true,
1515
.use_quartz = false,
1616
.target = target,
@@ -89,7 +89,11 @@ pub fn build(b: *std.Build) void {
8989
"src/init.cc",
9090
"src/itemize.cc",
9191
"src/FontManager.cc",
92-
if (target.result.os.tag == .windows) "src/FontManagerWindows.cc" else "src/FontManagerMacos.cc",
92+
switch (target.result.os.tag) {
93+
.windows => "src/FontManagerWindows.cc",
94+
.macos => "src/FontManagerMacos.cc",
95+
else => "src/FontManagerLinux.cc",
96+
},
9397
"src/FontFace.cc",
9498
"src/FontFaceSet.cc",
9599
"src/FontParser.cc",
@@ -125,6 +129,10 @@ pub fn build(b: *std.Build) void {
125129
canvas.linkSystemLibrary("dwrite");
126130
}
127131

132+
// Linux/BSD use FontConfig (FontManagerLinux.cc). It's expected to be
133+
// available statically via the cairo dependency; header/link wiring is
134+
// handled when building for those targets.
135+
128136
const move = b.addInstallFile(canvas.getEmittedBin(), "../bin/canvas.node");
129137
move.step.dependOn(&canvas.step);
130138
b.getInstallStep().dependOn(&move.step);

0 commit comments

Comments
 (0)