freetype: fix and re-enable harfbuzz
This wasn't actually broken due to a Zig bug, but rather due to some pragmas in Harfbuzz which forcibly enable this -Werror. Luckily, there's a macro you can define to disable them.
This commit is contained in:
parent
39959dd615
commit
867d111f6d
1 changed files with 19 additions and 22 deletions
|
|
@ -96,32 +96,29 @@ pub fn testStep(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.C
|
||||||
.freetype = .{
|
.freetype = .{
|
||||||
.brotli = true,
|
.brotli = true,
|
||||||
},
|
},
|
||||||
// TODO: harfbuzz is broken
|
.harfbuzz = .{},
|
||||||
// .harfbuzz = .{},
|
|
||||||
});
|
});
|
||||||
main_tests.main_pkg_path = sdkPath("/");
|
main_tests.main_pkg_path = sdkPath("/");
|
||||||
b.installArtifact(main_tests);
|
b.installArtifact(main_tests);
|
||||||
|
|
||||||
// TODO: harfbuzz is broken
|
const harfbuzz_tests = b.addTest(.{
|
||||||
// const harfbuzz_tests = b.addTest(.{
|
.name = "harfbuzz-tests",
|
||||||
// .name = "harfbuzz-tests",
|
.root_source_file = .{ .path = sdkPath("/src/harfbuzz/main.zig") },
|
||||||
// .root_source_file = .{ .path = sdkPath("/src/harfbuzz/main.zig") },
|
.target = target,
|
||||||
// .target = target,
|
.optimize = optimize,
|
||||||
// .optimize = optimize,
|
});
|
||||||
// });
|
harfbuzz_tests.addModule("freetype", module(b));
|
||||||
// harfbuzz_tests.addModule("freetype", module(b));
|
link(b, harfbuzz_tests, .{
|
||||||
// link(b, harfbuzz_tests, .{
|
.freetype = .{
|
||||||
// .freetype = .{
|
.brotli = true,
|
||||||
// .brotli = true,
|
},
|
||||||
// },
|
.harfbuzz = .{},
|
||||||
// .harfbuzz = .{},
|
});
|
||||||
// });
|
harfbuzz_tests.main_pkg_path = sdkPath("/");
|
||||||
// harfbuzz_tests.main_pkg_path = sdkPath("/");
|
b.installArtifact(harfbuzz_tests);
|
||||||
// b.installArtifact(harfbuzz_tests);
|
|
||||||
|
|
||||||
const main_tests_run = b.addRunArtifact(main_tests);
|
const main_tests_run = b.addRunArtifact(main_tests);
|
||||||
// TODO: harfbuzz is broken
|
main_tests_run.step.dependOn(&b.addRunArtifact(harfbuzz_tests).step);
|
||||||
// main_tests_run.step.dependOn(&b.addRunArtifact(harfbuzz_tests).step);
|
|
||||||
return main_tests_run;
|
return main_tests_run;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,12 +197,12 @@ pub fn buildHarfbuzz(b: *Build, optimize: std.builtin.OptimizeMode, target: std.
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
// TODO: `-Wno-error` is not respected for some reason; as a result harfbuzz builds are broken.
|
lib.addCSourceFile(hb_root ++ "/src/harfbuzz.cc", &.{});
|
||||||
lib.addCSourceFile(hb_root ++ "/src/harfbuzz.cc", &.{"-Wno-error=cast-function-type-strict"});
|
|
||||||
lib.linkLibCpp();
|
lib.linkLibCpp();
|
||||||
lib.addIncludePath(hb_include_path);
|
lib.addIncludePath(hb_include_path);
|
||||||
lib.addIncludePath(ft_include_path);
|
lib.addIncludePath(ft_include_path);
|
||||||
lib.defineCMacro("HAVE_FREETYPE", "1");
|
lib.defineCMacro("HAVE_FREETYPE", "1");
|
||||||
|
lib.defineCMacro("HB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR", "1");
|
||||||
|
|
||||||
if (options.install_libs)
|
if (options.install_libs)
|
||||||
b.installArtifact(lib);
|
b.installArtifact(lib);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue