Skip to content

Commit

Permalink
bump freetype, strip, ndebug
Browse files Browse the repository at this point in the history
  • Loading branch information
jethrodaniel committed Oct 5, 2024
1 parent c81470b commit 2651568
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub fn build(b: *std.Build) !void {
.name = "SDL3",
.target = target,
.optimize = optimize,
.strip = true,
});
{
lib.addIncludePath(sdl_dep.path("src"));
Expand All @@ -37,10 +38,11 @@ pub fn build(b: *std.Build) !void {
});

const SDL_ASSERT_LEVEL: u8 = switch (optimize) {
.ReleaseFast, .ReleaseSmall => 1,
.ReleaseSafe, .Debug => 3, // paranoid
.ReleaseFast, .ReleaseSmall, .ReleaseSafe => 0,
.Debug => 3,
};
lib.defineCMacro("SDL_ASSERT_LEVEL", b.fmt("{d}", .{SDL_ASSERT_LEVEL}));
lib.defineCMacro("NDEBUG", "1");

lib.linkLibC();

Expand Down Expand Up @@ -485,6 +487,7 @@ pub fn build(b: *std.Build) !void {
.target = target,
.optimize = optimize,
.root_source_file = b.addWriteFiles().add("stub.c", ""),
.strip = true,
});
{
sdl_for_libs.addIncludePath(sdl_dep.path("include"));
Expand All @@ -496,6 +499,7 @@ pub fn build(b: *std.Build) !void {
.name = "SDL3_ttf",
.target = target,
.optimize = optimize,
.strip = true,
});
{
SDL_ttf.addCSourceFiles(.{
Expand Down Expand Up @@ -561,6 +565,7 @@ pub fn build(b: *std.Build) !void {
.target = target,
.root_source_file = b.path(b.fmt("src/{s}.zig", .{name})),
.optimize = optimize,
.strip = true,
});
exe.root_module.addImport("sdl", module);

Expand Down
3 changes: 3 additions & 0 deletions build/freetype/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ pub fn build(b: *std.Build) !void {
.name = "freetype",
.target = target,
.optimize = optimize,
.strip = true,
});
{
lib.defineCMacro("NDEBUG", "1");

lib.addCSourceFiles(.{
.root = freetype_dep.path(""),
.files = &.{
Expand Down
4 changes: 2 additions & 2 deletions build/freetype/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
.dependencies = .{
// NOTE: matches SDL_ttf's external/freetype submodule
.freetype = .{
.url = "git+https://github.com/libsdl-org/freetype#12c5e620858bd503731091e9371d06c0a3e7c967",
.hash = "122024689aa770726588625a652c00354ea9b28e2afe1388a87e6854c51374ef2e84",
.url = "git+https://github.com/libsdl-org/freetype#c82745878da1acef2ce6bd7e17a8d59b8612d509",
.hash = "12208f11ed8d8b1a3c25331dcc89c382ca8de704192b469225c9fee58a038953d509",
},
},
}

0 comments on commit 2651568

Please sign in to comment.