From bd8a0be2aef2fe15b41c0ebdf566c51fd531da06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Catarino=20Fran=C3=A7a?= Date: Wed, 16 Aug 2023 14:27:16 -0300 Subject: [PATCH] updated to 0.11.0 released --- .github/workflows/build.yml | 2 +- build.zig | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0ae2c7..e8d70eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/build.zig b/build.zig index b57fccb..d2f1a8b 100644 --- a/build.zig +++ b/build.zig @@ -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); @@ -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); } @@ -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(); } }; @@ -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!");