diff options
| author | Gamer-Kold <[email protected]> | 2023-05-06 15:04:40 +0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-06 12:04:40 +0200 |
| commit | de748dfffefeba1ba9bcf0c90c538d32c9cb2020 (patch) | |
| tree | fa1692abfe9860a758aab27dc4c9756cb2933ad2 | |
| parent | 5573f0f1c7b29bfe46d0b70487e4adb4d01cba62 (diff) | |
| download | raylib-de748dfffefeba1ba9bcf0c90c538d32c9cb2020.tar.gz raylib-de748dfffefeba1ba9bcf0c90c538d32c9cb2020.zip | |
Fixed broken build.zig files. Now works with latest stable compiler (as of commit, latest is 0.10.1) (#3045)
Co-authored-by: Talha Qamar <[email protected]>
| -rw-r--r-- | build.zig | 2 | ||||
| -rw-r--r-- | src/build.zig | 16 |
2 files changed, 7 insertions, 11 deletions
@@ -1,6 +1,6 @@ const std = @import("std"); const raylib = @import("src/build.zig"); -pub fn build(b: *std.Build) void { +pub fn build(b: *std.build.Builder) void { raylib.build(b); } diff --git a/src/build.zig b/src/build.zig index b39f23ed..e4c1e0c4 100644 --- a/src/build.zig +++ b/src/build.zig @@ -1,6 +1,6 @@ const std = @import("std"); -pub fn addRaylib(b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.OptimizeMode) *std.Build.CompileStep { +pub fn addRaylib(b: *std.build.Builder, target: std.zig.CrossTarget) *std.build.LibExeObjStep { const raylib_flags = &[_][]const u8{ "-std=gnu99", "-D_GNU_SOURCE", @@ -8,11 +8,7 @@ pub fn addRaylib(b: *std.Build, target: std.zig.CrossTarget, optimize: std.built "-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/1891 }; - const raylib = b.addStaticLibrary(.{ - .name = "raylib", - .target = target, - .optimize = optimize, - }); + const raylib = b.addStaticLibrary("raylib", null); raylib.linkLibC(); raylib.addIncludePath(srcdir ++ "/external/glfw/include"); @@ -103,7 +99,7 @@ pub fn addRaylib(b: *std.Build, target: std.zig.CrossTarget, optimize: std.built return raylib; } -pub fn build(b: *std.Build) void { +pub fn build(b: *std.build.Builder) void { // Standard target options allows the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which // means any target is allowed, and the default is native. Other options @@ -112,10 +108,10 @@ pub fn build(b: *std.Build) void { // Standard optimization options allow the person running `zig build` to select // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not // set a preferred release mode, allowing the user to decide how to optimize. - const optimize = b.standardOptimizeOption(.{}); + // const optimize = b.standardReleaseOptions(); - const lib = addRaylib(b, target, optimize); - lib.installHeader("src/raylib.h", "raylib.h"); + const lib = addRaylib(b, target); + b.installFile("src/raylib.h", "raylib.h"); b.installArtifact(lib); } |
