Skip to content

Commit 86eb71e

Browse files
committed
Fix build for Zig 0.16.0-dev.1657+985a3565c, drop 0.14.x support
1 parent c02752e commit 86eb71e

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
zig-version: [0.14.0, latest]
1615
os: [ubuntu-latest, macos-latest, windows-latest]
1716
runs-on: ${{ matrix.os }}
1817
steps:
@@ -27,8 +26,6 @@ jobs:
2726
2827
- name: Setup Zig
2928
uses: mlugg/setup-zig@v2
30-
with:
31-
version: ${{ matrix.zig-version }}
3229

3330
- name: Check Formatting
3431
run: zig fmt --ast-check --check .

build.zig

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,43 @@ pub fn build(b: *std.Build) void {
99

1010
const upstream = b.dependency("SDL_ttf", .{});
1111

12+
const mod = b.createModule(.{
13+
.target = target,
14+
.optimize = optimize,
15+
.link_libc = true,
16+
.sanitize_c = sanitize_c,
17+
});
18+
1219
const lib = b.addLibrary(.{
1320
.name = "SDL2_ttf",
1421
.version = .{ .major = 2, .minor = 24, .patch = 0 },
1522
.linkage = .static,
16-
.root_module = b.createModule(.{
17-
.target = target,
18-
.optimize = optimize,
19-
.link_libc = true,
20-
.sanitize_c = sanitize_c,
21-
}),
23+
.root_module = mod,
2224
});
23-
lib.addCSourceFile(.{ .file = upstream.path("SDL_ttf.c") });
25+
mod.addCSourceFile(.{ .file = upstream.path("SDL_ttf.c") });
2426

2527
if (harfbuzz_enabled) {
2628
const harfbuzz_dep = b.dependency("harfbuzz", .{
2729
.target = target,
2830
.optimize = optimize,
2931
});
30-
lib.linkLibrary(harfbuzz_dep.artifact("harfbuzz"));
31-
lib.root_module.addCMacro("TTF_USE_HARFBUZZ", "1");
32+
mod.linkLibrary(harfbuzz_dep.artifact("harfbuzz"));
33+
mod.addCMacro("TTF_USE_HARFBUZZ", "1");
3234
}
3335

3436
const freetype_dep = b.dependency("freetype", .{
3537
.target = target,
3638
.optimize = optimize,
3739
});
38-
lib.linkLibrary(freetype_dep.artifact("freetype"));
40+
mod.linkLibrary(freetype_dep.artifact("freetype"));
3941

4042
const sdl_dep = b.dependency("SDL", .{
4143
.target = target,
4244
.optimize = optimize,
4345
});
4446
const sdl_lib = sdl_dep.artifact("SDL2");
45-
lib.linkLibrary(sdl_lib);
46-
lib.addIncludePath(sdl_lib.getEmittedIncludeTree().path(b, "SDL2"));
47+
mod.linkLibrary(sdl_lib);
48+
mod.addIncludePath(sdl_lib.getEmittedIncludeTree().path(b, "SDL2"));
4749

4850
lib.installHeader(upstream.path("SDL_ttf.h"), "SDL2/SDL_ttf.h");
4951

build.zig.zon

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
.name = .SDL_ttf,
33
.version = "2.24.0",
44
.fingerprint = 0xa98f7681c4b9d53c,
5-
.minimum_zig_version = "0.14.0",
5+
.minimum_zig_version = "0.15.2",
66
.dependencies = .{
77
.harfbuzz = .{
8-
.url = "git+https://github.com/allyourcodebase/harfbuzz#6bb522d22cee0ce1d1446bd59fa5b0417f25303e",
9-
.hash = "harfbuzz-8.5.0-Ip1VAqCZAADRh-K2AVujG0N3VAal-AKwkZrvlYOaloyB",
8+
.url = "git+https://github.com/allyourcodebase/harfbuzz#da947143173370b8123ef93f21353d58ce6e6d65",
9+
.hash = "harfbuzz-12.2.0-Ip1VAuGZAAD2dBKDBtAW50eyC9VhSmXFlupI1vCNTFL4",
1010
},
1111
.freetype = .{
12-
.url = "git+https://github.com/allyourcodebase/freetype#9d847affbd224cf6a7303ad6d98715e3675ef78c",
13-
.hash = "freetype-2.13.3-C3-WdeyJAAD9z8BeYYQ8N3gNlPI9NvHRxg5039S5vhz7",
12+
.url = "git+https://github.com/allyourcodebase/freetype#f2f3f662cfc6cf7be2d39d8373c6e6b91297ced8",
13+
.hash = "freetype-2.14.1-C3-WdWqKAADgPV0BhYffbFweY71Qns18mICAEtclm1a6",
1414
},
1515
.SDL = .{
16-
.url = "git+https://github.com/allyourcodebase/SDL#a91ef63a07449874ec049dacfd6459b1131fd27b",
17-
.hash = "SDL-2.32.10-JToi3_a0EgFQAnsafUA-gNv9ku-yxMoYF9Wjq7HhD5q5",
16+
.url = "git+https://github.com/allyourcodebase/SDL#25dc764272bf117198f3cd6f44f52dae5c45d60a",
17+
.hash = "SDL-2.32.10-JToi38G1EgFICTNzwfhy7XOMuWw7gN1xDvPOQ5CCoI8R",
1818
},
1919
.SDL_ttf = .{
2020
.url = "git+https://github.com/libsdl-org/SDL_ttf#release-2.24.0",

0 commit comments

Comments
 (0)