Skip to content

Commit

Permalink
remove win32 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ross96D committed Dec 23, 2024
1 parent 85192a0 commit a9da607
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 124 deletions.
5 changes: 0 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,12 @@ inline fn dependencies(
.target = target,
.optimize = optimize,
});
const win32: ?*std.Build.Dependency = if (target.result.os.tag == .windows)
b.dependency("win32", .{})
else
null;
const zli = b.dependency("zli", .{ .target = target, .optimize = optimize });

return &[_]?Dep{
Dep.init(jdz_allocator, "jdz_allocator"),
Dep.init(zart, "zart"),
Dep.init(zli, "zli"),
if (target.result.os.tag == .windows) Dep.init(win32.?, "win32") else null,
};
}

Expand Down
1 change: 0 additions & 1 deletion external/zigwin32/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions external/zigwin32/LICENSE

This file was deleted.

9 changes: 0 additions & 9 deletions external/zigwin32/build.zig

This file was deleted.

14 changes: 0 additions & 14 deletions external/zigwin32/build.zig.zon

This file was deleted.

12 changes: 0 additions & 12 deletions external/zigwin32/win32.zig

This file was deleted.

4 changes: 0 additions & 4 deletions external/zigwin32/win32/storage.zig

This file was deleted.

43 changes: 0 additions & 43 deletions external/zigwin32/win32/storage/file_system.zig

This file was deleted.

25 changes: 0 additions & 25 deletions external/zigwin32/win32/zig.zig

This file was deleted.

14 changes: 10 additions & 4 deletions src/utils.zig
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ test Owned {
pub inline fn tempDir() !std.fs.Dir {
const path: []const u8 = switch (builtin.os.tag) {
.windows => r: {
var path: [256:0]u8 = undefined;
const n = @import("win32").storage.file_system.GetTempPath2(256, &path);
std.debug.assert(n > 0);
break :r path[0..n];
var path: [512]u8 = undefined;
var fba = std.heap.FixedBufferAllocator.init(&path);
break :r if (std.process.getEnvVarOwned(fba.allocator(), "TMP")) |dir|
dir
else |_| if (std.process.getEnvVarOwned(fba.allocator(), "TEMP")) |dir|
dir
else |_| if (std.process.getEnvVarOwned(fba.allocator(), "USERPROFILE")) |dir|
dir
else
"C:\\Windows";
},
else => if (std.posix.getenv("TMPDIR")) |path| path else "/tmp",
};
Expand Down

0 comments on commit a9da607

Please sign in to comment.