Skip to content

Update zsdl #744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ pub fn build(b: *std.Build) void {
}
}

// Install prebuilt SDL2 libs in bin output dir
if (@import("zsdl").prebuilt_sdl2.install(b, options.target.result, .bin, .{
.ttf = true,
.image = true,
})) |install_sdl2_step| {
b.getInstallStep().dependOn(install_sdl2_step);
}

{ // Benchmarks
const benchmark_step = b.step("benchmark", "Run all benchmarks");
const zmath = b.dependency("zmath", .{
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@
},

.zsdl = .{
.url = "https://github.com/zig-gamedev/zsdl/archive/48a230277225fd8e731fe6bedd1b543d54c94d8a.tar.gz",
.hash = "1220d5669fa5c68b1de8e27bf1f71cd4d3adc0e1f9de7ef9ec50644468596822f3ea",
.url = "https://github.com/zig-gamedev/zsdl/archive/9635e2f996e86cd46ce939752b7a8c47f9883b9e.tar.gz",
.hash = "1220a5251c77af0d18c54ab1754fb0a296b9e4894b544b365c3e3da3c661b3b6f2aa",
},
.@"sdl2-prebuilt-macos" = .{
.url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/f14773fa3de719b3a399b854c31eb4139d63842f.tar.gz",
Expand Down
6 changes: 1 addition & 5 deletions experiments/genart/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn install(
exe.root_module.addImport("zsdl2", zsdl2_module);

@import("zsdl").link_SDL2(exe);
@import("zsdl").prebuilt.addLibraryPathsTo(exe);
@import("zsdl").prebuilt_sdl2.addLibraryPathsTo(exe);

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

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

if (@import("zsdl").prebuilt.install_SDL2(b, target.result, .bin)) |install_sdl2_step| {
install_step.dependOn(install_sdl2_step);
}

const run_step = b.step(
name ++ "-run",
"Run '" ++ desc_name[0..desc_size] ++ "' genart experiment",
Expand Down
2 changes: 1 addition & 1 deletion libs/zsdl
Submodule zsdl updated 4 files
+6 −9 README.md
+121 −133 build.zig
+55 −0 src/sdl2.zig
+5 −5 src/sdl3.zig
7 changes: 1 addition & 6 deletions samples/minimal_sdl_gl/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile {
const zsdl = b.dependency("zsdl", .{});
exe.root_module.addImport("zsdl2", zsdl.module("zsdl2"));

@import("zsdl").prebuilt.addLibraryPathsTo(exe);

if (@import("zsdl").prebuilt.install_SDL2(b, options.target.result, .bin)) |install_sdl2_step| {
exe.step.dependOn(install_sdl2_step);
}

@import("zsdl").prebuilt_sdl2.addLibraryPathsTo(exe);
@import("zsdl").link_SDL2(exe);

const zopengl = b.dependency("zopengl", .{});
Expand Down
10 changes: 1 addition & 9 deletions samples/sdl2_demo/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,7 @@ pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile {
exe.root_module.addImport("zsdl2", zsdl.module("zsdl2"));
exe.root_module.addImport("zsdl2_image", zsdl.module("zsdl2_image"));

@import("zsdl").prebuilt.addLibraryPathsTo(exe);

if (@import("zsdl").prebuilt.install_SDL2(b, options.target.result, .bin)) |install_lib_step| {
exe.step.dependOn(install_lib_step);
}

if (@import("zsdl").prebuilt.install_SDL2_image(b, options.target.result, .bin)) |install_lib_step| {
exe.step.dependOn(install_lib_step);
}
@import("zsdl").prebuilt_sdl2.addLibraryPathsTo(exe);

@import("zsdl").link_SDL2(exe);
@import("zsdl").link_SDL2_image(exe);
Expand Down
Loading
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