diff --git a/build.zig b/build.zig index 9830e71..10e81e7 100644 --- a/build.zig +++ b/build.zig @@ -42,7 +42,12 @@ pub fn build(b: *std.Build) !void { .Debug => 3, }; lib.defineCMacro("SDL_ASSERT_LEVEL", b.fmt("{d}", .{SDL_ASSERT_LEVEL})); - lib.defineCMacro("NDEBUG", "1"); + + if (optimize != .Debug) { + lib.defineCMacro("NDEBUG", "1"); + lib.defineCMacro("__FILE__", "\"__FILE__\""); + lib.defineCMacro("__LINE__", "0"); + } lib.linkLibC(); diff --git a/build/freetype/build.zig b/build/freetype/build.zig index bbd7d53..d3f77f1 100644 --- a/build/freetype/build.zig +++ b/build/freetype/build.zig @@ -19,7 +19,11 @@ pub fn build(b: *std.Build) !void { .strip = true, }); { - lib.defineCMacro("NDEBUG", "1"); + if (optimize != .Debug) { + lib.defineCMacro("NDEBUG", "1"); + lib.defineCMacro("__FILE__", "\"__FILE__\""); + lib.defineCMacro("__LINE__", "0"); + } lib.addCSourceFiles(.{ .root = freetype_dep.path(""),