Skip to content

Commit 4bc95e9

Browse files
authored
Update zsdl (#744)
1 parent a3f23f7 commit 4bc95e9

File tree

6 files changed

+14
-23
lines changed

6 files changed

+14
-23
lines changed

build.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ pub fn build(b: *std.Build) void {
8181
}
8282
}
8383

84+
// Install prebuilt SDL2 libs in bin output dir
85+
if (@import("zsdl").prebuilt_sdl2.install(b, options.target.result, .bin, .{
86+
.ttf = true,
87+
.image = true,
88+
})) |install_sdl2_step| {
89+
b.getInstallStep().dependOn(install_sdl2_step);
90+
}
91+
8492
{ // Benchmarks
8593
const benchmark_step = b.step("benchmark", "Run all benchmarks");
8694
const zmath = b.dependency("zmath", .{

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@
127127
},
128128

129129
.zsdl = .{
130-
.url = "https://github.com/zig-gamedev/zsdl/archive/48a230277225fd8e731fe6bedd1b543d54c94d8a.tar.gz",
131-
.hash = "1220d5669fa5c68b1de8e27bf1f71cd4d3adc0e1f9de7ef9ec50644468596822f3ea",
130+
.url = "https://github.com/zig-gamedev/zsdl/archive/9635e2f996e86cd46ce939752b7a8c47f9883b9e.tar.gz",
131+
.hash = "1220a5251c77af0d18c54ab1754fb0a296b9e4894b544b365c3e3da3c661b3b6f2aa",
132132
},
133133
.@"sdl2-prebuilt-macos" = .{
134134
.url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/f14773fa3de719b3a399b854c31eb4139d63842f.tar.gz",

experiments/genart/build.zig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn install(
7676
exe.root_module.addImport("zsdl2", zsdl2_module);
7777

7878
@import("zsdl").link_SDL2(exe);
79-
@import("zsdl").prebuilt.addLibraryPathsTo(exe);
79+
@import("zsdl").prebuilt_sdl2.addLibraryPathsTo(exe);
8080

8181
exe.root_module.addImport("zopengl", zopengl_module);
8282

@@ -86,10 +86,6 @@ fn install(
8686
);
8787
install_step.dependOn(&b.addInstallArtifact(exe, .{}).step);
8888

89-
if (@import("zsdl").prebuilt.install_SDL2(b, target.result, .bin)) |install_sdl2_step| {
90-
install_step.dependOn(install_sdl2_step);
91-
}
92-
9389
const run_step = b.step(
9490
name ++ "-run",
9591
"Run '" ++ desc_name[0..desc_size] ++ "' genart experiment",

samples/minimal_sdl_gl/build.zig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile {
1616
const zsdl = b.dependency("zsdl", .{});
1717
exe.root_module.addImport("zsdl2", zsdl.module("zsdl2"));
1818

19-
@import("zsdl").prebuilt.addLibraryPathsTo(exe);
20-
21-
if (@import("zsdl").prebuilt.install_SDL2(b, options.target.result, .bin)) |install_sdl2_step| {
22-
exe.step.dependOn(install_sdl2_step);
23-
}
24-
19+
@import("zsdl").prebuilt_sdl2.addLibraryPathsTo(exe);
2520
@import("zsdl").link_SDL2(exe);
2621

2722
const zopengl = b.dependency("zopengl", .{});

samples/sdl2_demo/build.zig

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,7 @@ pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile {
2323
exe.root_module.addImport("zsdl2", zsdl.module("zsdl2"));
2424
exe.root_module.addImport("zsdl2_image", zsdl.module("zsdl2_image"));
2525

26-
@import("zsdl").prebuilt.addLibraryPathsTo(exe);
27-
28-
if (@import("zsdl").prebuilt.install_SDL2(b, options.target.result, .bin)) |install_lib_step| {
29-
exe.step.dependOn(install_lib_step);
30-
}
31-
32-
if (@import("zsdl").prebuilt.install_SDL2_image(b, options.target.result, .bin)) |install_lib_step| {
33-
exe.step.dependOn(install_lib_step);
34-
}
26+
@import("zsdl").prebuilt_sdl2.addLibraryPathsTo(exe);
3527

3628
@import("zsdl").link_SDL2(exe);
3729
@import("zsdl").link_SDL2_image(exe);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy