Skip to content

Commit

Permalink
updated to 0.11.0 released
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Aug 16, 2023
1 parent 6bd144f commit bd8a0be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- uses: goto-bus-stop/setup-zig@v2
with:
version: master
version: 0.11.0
- uses: baptiste0928/cargo-install@v2
with:
crate: xwin
Expand Down
28 changes: 14 additions & 14 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ fn buildExe(b: *std.Build, info: BuildInfo) void {
// zig w/ msvc no has libcxx support
// https://github.com/ziglang/zig/issues/5312
.cpp => {
exe.addCSourceFile(info.filepath, &.{
exe.addCSourceFile(.{ .file = .{ .path = info.filepath }, .flags = &.{
"-Wall",
"-Wextra",
});
} });
exe.want_lto = false;
if (exe.target.getAbi() == .msvc) {
xWin(b, exe);
Expand All @@ -49,10 +49,10 @@ fn buildExe(b: *std.Build, info: BuildInfo) void {
}
},
.c => {
exe.addCSourceFile(info.filepath, &.{
exe.addCSourceFile(.{ .file = .{ .path = info.filepath }, .flags = &.{
"-Wall",
"-Wextra",
});
} });
if (exe.target.getAbi() == .msvc) {
xWin(b, exe);
}
Expand Down Expand Up @@ -85,7 +85,7 @@ const BuildInfo = struct {
optimize: std.builtin.OptimizeMode,

fn filename(self: BuildInfo) []const u8 {
var split = std.mem.split(u8, std.fs.path.basename(self.filepath), ".");
var split = std.mem.splitSequence(u8, std.fs.path.basename(self.filepath), ".");
return split.first();
}
};
Expand All @@ -100,15 +100,15 @@ fn xWin(b: *std.Build, exe: *std.Build.Step.Compile) void {
};

exe.setLibCFile(.{ .path = sdkPath("/libc.txt") });
exe.addSystemIncludePath(sdkPath("/.xwin/crt/include"));
exe.addSystemIncludePath(sdkPath("/.xwin/sdk/include"));
exe.addSystemIncludePath(sdkPath("/.xwin/sdk/include/10.0.22000/cppwinrt"));
exe.addSystemIncludePath(sdkPath("/.xwin/sdk/include/10.0.22000/ucrt"));
exe.addSystemIncludePath(sdkPath("/.xwin/sdk/include/10.0.22000/um"));
exe.addSystemIncludePath(sdkPath("/.xwin/sdk/include/10.0.22000/shared"));
exe.addLibraryPath(b.fmt(sdkPath("/.xwin/crt/lib/{s}"), .{arch}));
exe.addLibraryPath(b.fmt(sdkPath("/.xwin/sdk/lib/ucrt/{s}"), .{arch}));
exe.addLibraryPath(b.fmt(sdkPath("/.xwin/sdk/lib/um/{s}"), .{arch}));
exe.addSystemIncludePath(.{ .path = sdkPath("/.xwin/crt/include") });
exe.addSystemIncludePath(.{ .path = sdkPath("/.xwin/sdk/include") });
exe.addSystemIncludePath(.{ .path = sdkPath("/.xwin/sdk/include/10.0.22000/cppwinrt") });
exe.addSystemIncludePath(.{ .path = sdkPath("/.xwin/sdk/include/10.0.22000/ucrt") });
exe.addSystemIncludePath(.{ .path = sdkPath("/.xwin/sdk/include/10.0.22000/um") });
exe.addSystemIncludePath(.{ .path = sdkPath("/.xwin/sdk/include/10.0.22000/shared") });
exe.addLibraryPath(.{ .path = b.fmt(sdkPath("/.xwin/crt/lib/{s}"), .{arch}) });
exe.addLibraryPath(.{ .path = b.fmt(sdkPath("/.xwin/sdk/lib/ucrt/{s}"), .{arch}) });
exe.addLibraryPath(.{ .path = b.fmt(sdkPath("/.xwin/sdk/lib/um/{s}"), .{arch}) });
}
fn sdkPath(comptime suffix: []const u8) []const u8 {
if (suffix[0] != '/') @compileError("relToPath requires an absolute path!");
Expand Down

0 comments on commit bd8a0be

Please sign in to comment.