summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMike Will <[email protected]>2024-07-01 06:22:12 -0400
committerGitHub <[email protected]>2024-07-01 12:22:12 +0200
commit9e22fddf1ac54d0075f1b4a5c2bbc819116dfb83 (patch)
tree653c651fea38b2a9fc8de591f8a8678d12aa853c
parentc8313d9ebc428590c7098a75d2db0eed1d877127 (diff)
downloadraylib-9e22fddf1ac54d0075f1b4a5c2bbc819116dfb83.tar.gz
raylib-9e22fddf1ac54d0075f1b4a5c2bbc819116dfb83.zip
[build.zig] Make emscripten build compatible with Zig 0.13.0 (#4121)
-rw-r--r--.gitignore1
-rw-r--r--src/build.zig12
2 files changed, 4 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index eeb1ed09..d857bf2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -104,6 +104,7 @@ GRTAGS
GTAGS
# Zig programming language
+.zig-cache/
zig-cache/
zig-out/
build/
diff --git a/src/build.zig b/src/build.zig
index 0b85e5f8..3b462de6 100644
--- a/src/build.zig
+++ b/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");