[build.zig] Make emscripten build compatible with Zig 0.13.0 (#4121)
This commit is contained in:
parent
c8313d9ebc
commit
9e22fddf1a
1
.gitignore
vendored
1
.gitignore
vendored
@ -104,6 +104,7 @@ GRTAGS
|
|||||||
GTAGS
|
GTAGS
|
||||||
|
|
||||||
# Zig programming language
|
# Zig programming language
|
||||||
|
.zig-cache/
|
||||||
zig-cache/
|
zig-cache/
|
||||||
zig-out/
|
zig-out/
|
||||||
build/
|
build/
|
||||||
|
@ -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");
|
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);
|
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!");
|
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();
|
dir.close();
|
||||||
raylib.addIncludePath(.{ .path = cache_include });
|
raylib.addIncludePath(.{ .cwd_relative = cache_include });
|
||||||
}
|
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
@panic("Unsupported OS");
|
@panic("Unsupported OS");
|
||||||
|
Loading…
Reference in New Issue
Block a user