diff --git a/build.zig b/build.zig index f847854dc..894db26ae 100644 --- a/build.zig +++ b/build.zig @@ -676,6 +676,10 @@ fn addDeps( }; // Dependencies + const fontconfig_dep = b.dependency("fontconfig", .{ + .target = step.target, + .optimize = step.optimize, + }); const freetype_dep = b.dependency("freetype", .{ .target = step.target, .optimize = step.optimize, @@ -790,32 +794,10 @@ fn addDeps( try static_libs.append(pixman_step.getEmittedBin()); // Only Linux gets fontconfig - // if (font_backend.hasFontconfig()) { - // // Libxml2 - // const libxml2_lib = try libxml2.create( - // b, - // step.target, - // step.optimize, - // .{ - // .lzma = false, - // .zlib = false, - // .iconv = !step.target.isWindows(), - // }, - // ); - // libxml2_lib.link(step); - // - // // Fontconfig - // const fontconfig_step = try fontconfig.link(b, step, .{ - // .freetype = .{ - // .enabled = true, - // .step = freetype_step, - // .include = &freetype.include_paths, - // }, - // - // .libxml2 = true, - // }); - // libxml2_lib.link(fontconfig_step); - // } + if (font_backend.hasFontconfig()) { + // Fontconfig + step.linkLibrary(fontconfig_dep.artifact("fontconfig")); + } } if (!lib) { diff --git a/build.zig.zon b/build.zig.zon index d79d75980..4505db8fe 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,6 +2,7 @@ .name = "ghostty", .version = "0.1.0", .dependencies = .{ + .fontconfig = .{ .path = "./pkg/fontconfig" }, .freetype = .{ .path = "./pkg/freetype" }, .harfbuzz = .{ .path = "./pkg/harfbuzz" }, .libpng = .{ .path = "./pkg/libpng" },