diff --git a/src/build.zig b/src/build.zig index 8194e1e3c13f..6a4c07e7eaa6 100644 --- a/src/build.zig +++ b/src/build.zig @@ -1,10 +1,6 @@ const std = @import("std"); pub fn addRaylib(b: *std.build.Builder, target: std.zig.CrossTarget) *std.build.LibExeObjStep { - // Standard release options allow the person running `zig build` to select - // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. - const mode = b.standardReleaseOptions(); - const raylib_flags = &[_][]const u8{ "-std=gnu99", "-DPLATFORM_DESKTOP", @@ -13,9 +9,8 @@ pub fn addRaylib(b: *std.build.Builder, target: std.zig.CrossTarget) *std.build. "-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/1891 }; - const raylib = b.addStaticLibrary("raylib", srcdir ++ "/raylib.h"); + const raylib = b.addStaticLibrary("raylib", null); raylib.setTarget(target); - raylib.setBuildMode(mode); raylib.linkLibC(); raylib.addIncludePath(srcdir ++ "/external/glfw/include"); @@ -90,8 +85,8 @@ pub fn build(b: *std.build.Builder) void { lib.install(); } -const srcdir = getSrcDir(); - -fn getSrcDir() []const u8 { - return std.fs.path.dirname(@src().file) orelse "."; -} +const srcdir = struct{ + fn getSrcDir() []const u8 { + return std.fs.path.dirname(@src().file).?; + } +}.getSrcDir();