Skip to content

Commit

Permalink
update to Zig 2024.05
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
emidoots committed Jun 2, 2024
1 parent 0298f5e commit c1bcd1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Zig stuff
/zig-*
.zig-cache
8 changes: 4 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ pub fn build(b: *std.Build) void {
.root_source_file = b.addWriteFiles().add("empty.c", ""),
});
if (target.result.cpu.arch == .x86_64 and target.result.os.tag == .windows) {
lib.addLibraryPath(.{ .path = "x86_64" });
lib.addLibraryPath(b.path("x86_64"));
lib.linkSystemLibrary("dxguid");
lib.linkSystemLibrary("dxgi");
}
b.installArtifact(lib);

lib.installHeadersDirectory("include", ".");
lib.installHeadersDirectory(b.path("include"), ".", .{});
}

// TODO(build-system): this is needed because lib2.linkLibrary(lib)
// will not add the library path transitively to lib3.linkLibrary(lib2)
pub fn addLibraryPath(step: *std.Build.Step.Compile) void {
step.addLibraryPath(.{ .path = sdkPath("/x86_64") });
step.addLibraryPath(.{ .cwd_relative = sdkPath("/x86_64") });
}

pub fn addLibraryPathToModule(module: *std.Build.Module) void {
module.addLibraryPath(.{ .path = sdkPath("/x86_64") });
module.addLibraryPath(.{ .cwd_relative = sdkPath("/x86_64") });
}

fn sdkPath(comptime suffix: []const u8) []const u8 {
Expand Down

0 comments on commit c1bcd1f

Please sign in to comment.