always link system freetype2 using pkg-config

This commit is contained in:
Jan200101
2025-01-03 22:42:01 +01:00
parent 72e0fb14fe
commit 1dc9157727
2 changed files with 6 additions and 2 deletions

View File

@ -186,7 +186,7 @@ pub fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*st
_ = b.systemIntegrationOption("freetype", .{}); // So it shows up in help _ = b.systemIntegrationOption("freetype", .{}); // So it shows up in help
if (freetype_enabled) { if (freetype_enabled) {
if (b.systemIntegrationOption("freetype", .{})) { if (b.systemIntegrationOption("freetype", .{})) {
lib.linkSystemLibrary2("freetype", dynamic_link_opts); lib.linkSystemLibrary2("freetype2", dynamic_link_opts);
} else { } else {
const freetype_dep = b.dependency( const freetype_dep = b.dependency(
"freetype", "freetype",

View File

@ -43,7 +43,11 @@ pub fn build(b: *std.Build) !void {
{ {
var it = module.import_table.iterator(); var it = module.import_table.iterator();
while (it.next()) |entry| test_exe.root_module.addImport(entry.key_ptr.*, entry.value_ptr.*); while (it.next()) |entry| test_exe.root_module.addImport(entry.key_ptr.*, entry.value_ptr.*);
if (b.systemIntegrationOption("freetype", .{})) {
test_exe.linkSystemLibrary2("freetype2", dynamic_link_opts);
} else {
test_exe.linkLibrary(freetype.artifact("freetype")); test_exe.linkLibrary(freetype.artifact("freetype"));
}
const tests_run = b.addRunArtifact(test_exe); const tests_run = b.addRunArtifact(test_exe);
const test_step = b.step("test", "Run tests"); const test_step = b.step("test", "Run tests");
test_step.dependOn(&tests_run.step); test_step.dependOn(&tests_run.step);