pkg/fontconfig: make iconv build param non-windows specific

This commit is contained in:
Mitchell Hashimoto
2023-10-23 08:40:25 -07:00
parent f4a2273ad9
commit b9b33ab25d
2 changed files with 6 additions and 3 deletions

View File

@ -625,7 +625,6 @@ fn addDeps(
const fontconfig_dep = b.dependency("fontconfig", .{
.target = step.target,
.optimize = step.optimize,
.@"enable-iconv-win" = false,
});
const freetype_dep = b.dependency("freetype", .{
.target = step.target,

View File

@ -6,7 +6,11 @@ pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
const libxml2_enabled = b.option(bool, "enable-libxml2", "Build libxml2") orelse true;
const iconv_win_enabled = b.option(bool, "enable-iconv-win", "Build libxml2 with iconv on Windows") orelse false;
const libxml2_iconv_enabled = b.option(
bool,
"enable-libxml2-iconv",
"Build libxml2 with iconv",
) orelse (target.getOsTag() != .windows);
const freetype_enabled = b.option(bool, "enable-freetype", "Build freetype") orelse true;
_ = b.addModule("fontconfig", .{ .source_file = .{ .path = "main.zig" } });
@ -29,7 +33,7 @@ pub fn build(b: *std.Build) !void {
const libxml2_dep = b.dependency("libxml2", .{
.target = target,
.optimize = optimize,
.iconv = target.getOsTag() != .windows or iconv_win_enabled,
.iconv = libxml2_iconv_enabled,
});
lib.linkLibrary(libxml2_dep.artifact("xml2"));
}