Skip to content

Commit

Permalink
NDEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
jethrodaniel committed Oct 5, 2024
1 parent 2651568 commit 1427418
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 5 additions & 1 deletion build/freetype/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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(""),
Expand Down

0 comments on commit 1427418

Please sign in to comment.