瀏覽代碼

[build.zig] Make emscripten build compatible with Zig 0.13.0 (#4121)

pull/4127/head
Mike Will 5 月之前
committed by GitHub
父節點
當前提交
9e22fddf1a
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: B5690EEEBB952194
共有 2 個文件被更改,包括 4 次插入9 次删除
  1. +1
    -0
      .gitignore
  2. +3
    -9
      src/build.zig

+ 1
- 0
.gitignore 查看文件

@ -104,6 +104,7 @@ GRTAGS
GTAGS
# Zig programming language
.zig-cache/
zig-cache/
zig-out/
build/

+ 3
- 9
src/build.zig 查看文件

@ -207,15 +207,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
const cache_include = std.fs.path.join(b.allocator, &.{ b.sysroot.?, "cache", "sysroot", "include" }) catch @panic("Out of memory");
defer b.allocator.free(cache_include);
if (comptime builtin.zig_version.minor > 12) {
var dir = std.fs.cwd().openDir(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
dir.close();
raylib.addIncludePath(b.path(cache_include));
} else {
var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
dir.close();
raylib.addIncludePath(.{ .path = cache_include });
}
var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
dir.close();
raylib.addIncludePath(.{ .cwd_relative = cache_include });
},
else => {
@panic("Unsupported OS");

Loading…
取消
儲存