Skip to content

Commit

Permalink
fix build on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Oct 2, 2023
1 parent ccd6eee commit 3a4842a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 7 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -855,17 +855,20 @@ fn addSystemSDK(
try @import("apple_sdk").addPaths(b, step);
}

if (step.target.isLinux()) {
step.linkLibrary(b.dependency("x11_headers", .{
.target = step.target,
.optimize = step.optimize,
}).artifact("x11-headers"));
}

// GLFW requires these on all platforms so we just add them here. It
// doesn't hurt to add them if we don't use GLFW since they're all
// namespaced.
step.linkLibrary(b.dependency("vulkan_headers", .{
.target = step.target,
.optimize = step.optimize,
}).artifact("vulkan-headers"));
// step.linkLibrary(b.dependency("x11_headers", .{
// .target = step.target,
// .optimize = step.optimize,
// }).artifact("x11-headers"));
}

fn benchSteps(
Expand Down
4 changes: 4 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,9 @@
.url = "https://pkg.machengine.org/vulkan-headers/fc495148a910ac7817ce0ec2d5948231806f2ac0.tar.gz",
.hash = "12209aeba80369fa8638b82179b47e6742adb98a3a5b01bc518565504a922baad3e4",
},
.x11_headers = .{
.url = "https://pkg.machengine.org/x11-headers/26d12e9fc0d893085bcb711088a4a19afdff1adc.tar.gz",
.hash = "1220371a61d8bb57fce8ee1741f623cc19b0edd7d1b4adc9918663f8a7ef08aa4f3f",
},
},
}
2 changes: 1 addition & 1 deletion pkg/fontconfig/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ pub fn build(b: *std.Build) !void {
lib.installHeadersDirectoryOptions(.{
.source_dir = upstream.path("fontconfig"),
.install_dir = .header,
.install_subdir = "",
.install_subdir = "fontconfig",
.include_extensions = &.{".h"},
});

Expand Down

0 comments on commit 3a4842a

Please sign in to comment.