chore: update SDL.zig and zgui

This commit is contained in:
Rekai Nyangadzayi Musuka 2024-03-22 12:53:11 -05:00
parent ef93bbe084
commit b4830326ff
5 changed files with 13 additions and 14 deletions

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "lib/zgui"]
path = lib/zgui
url = https://git.musuka.dev/paoda/zgui
[submodule "lib/SDL.zig"] [submodule "lib/SDL.zig"]
path = lib/SDL.zig path = lib/SDL.zig
url = https://github.com/paoda/SDL.zig url = https://github.com/paoda/SDL.zig

View File

@ -2,7 +2,6 @@ const std = @import("std");
const builtin = @import("builtin"); const builtin = @import("builtin");
const Sdk = @import("lib/SDL.zig/build.zig"); const Sdk = @import("lib/SDL.zig/build.zig");
const zgui = @import("lib/zgui/build.zig");
const SemVer = std.SemanticVersion; const SemVer = std.SemanticVersion;
@ -24,6 +23,10 @@ pub fn build(b: *std.Build) void {
.optimize = optimize, .optimize = optimize,
}); });
const sdk = Sdk.init(b, null); // https://github.com/MasterQ32/SDL.zig
const zgui = b.dependency("zgui", .{ .shared = false, .with_implot = true, .backend = .sdl2_opengl3 });
const imgui = zgui.artifact("imgui");
exe.root_module.addImport("known_folders", b.dependency("known-folders", .{}).module("known-folders")); // https://github.com/ziglibs/known-folders exe.root_module.addImport("known_folders", b.dependency("known-folders", .{}).module("known-folders")); // https://github.com/ziglibs/known-folders
exe.root_module.addImport("datetime", b.dependency("zig-datetime", .{}).module("zig-datetime")); // https://github.com/frmdstryr/zig-datetime exe.root_module.addImport("datetime", b.dependency("zig-datetime", .{}).module("zig-datetime")); // https://github.com/frmdstryr/zig-datetime
exe.root_module.addImport("clap", b.dependency("zig-clap", .{}).module("clap")); // https://github.com/Hejsil/zig-clap exe.root_module.addImport("clap", b.dependency("zig-clap", .{}).module("clap")); // https://github.com/Hejsil/zig-clap
@ -32,20 +35,16 @@ pub fn build(b: *std.Build) void {
exe.root_module.addImport("arm32", b.dependency("arm32", .{}).module("arm32")); // https://git.musuka.dev/paoda/arm32 exe.root_module.addImport("arm32", b.dependency("arm32", .{}).module("arm32")); // https://git.musuka.dev/paoda/arm32
exe.root_module.addImport("gdbstub", b.dependency("zba-gdbstub", .{}).module("gdbstub")); // https://git.musuka.dev/paoda/gdbstub exe.root_module.addImport("gdbstub", b.dependency("zba-gdbstub", .{}).module("gdbstub")); // https://git.musuka.dev/paoda/gdbstub
exe.root_module.addImport("nfd", b.dependency("nfd", .{}).module("nfd")); // https://github.com/fabioarnold/nfd-zig exe.root_module.addImport("nfd", b.dependency("nfd", .{}).module("nfd")); // https://github.com/fabioarnold/nfd-zig
exe.root_module.addImport("zgui", zgui.module("root")); // https://git.musuka.dev/paoda/zgui
exe.root_module.addImport("sdl2", sdk.getNativeModule());
exe.root_module.addAnonymousImport("bitfield", .{ .root_source_file = .{ .path = "lib/bitfield.zig" } }); // https://github.com/FlorenceOS/ exe.root_module.addAnonymousImport("bitfield", .{ .root_source_file = .{ .path = "lib/bitfield.zig" } }); // https://github.com/FlorenceOS/
exe.root_module.addAnonymousImport("gl", .{ .root_source_file = .{ .path = "lib/gl.zig" } }); // https://github.com/MasterQ32/zig-opengl exe.root_module.addAnonymousImport("gl", .{ .root_source_file = .{ .path = "lib/gl.zig" } }); // https://github.com/MasterQ32/zig-opengl
exe.root_module.addAnonymousImport("example.toml", .{ .root_source_file = .{ .path = "example.toml" } }); exe.root_module.addAnonymousImport("example.toml", .{ .root_source_file = .{ .path = "example.toml" } });
// https://github.com/MasterQ32/SDL.zig
const sdk = Sdk.init(b, null);
sdk.link(exe, .dynamic); sdk.link(exe, .dynamic);
exe.root_module.addImport("sdl2", sdk.getNativeModule()); sdk.link(imgui, .dynamic);
exe.linkLibrary(imgui);
// https://git.musuka.dev/paoda/zgui
const zgui_pkg = zgui.package(b, target, optimize, .{ .options = .{ .backend = .sdl2_opengl3 } });
zgui_pkg.link(exe);
sdk.link(zgui_pkg.zgui_c_cpp, .dynamic);
b.installArtifact(exe); b.installArtifact(exe);

View File

@ -41,5 +41,9 @@
.url = "https://git.musuka.dev/paoda/arm32/archive/6f0e27136072610e6dba97ff8aaf5e2ec86e2c09.tar.gz", .url = "https://git.musuka.dev/paoda/arm32/archive/6f0e27136072610e6dba97ff8aaf5e2ec86e2c09.tar.gz",
.hash = "122047d0affe12b9e9e9c655a7ba6d51b311f02d688e9f1c9a91394a03103f1c0cd5", .hash = "122047d0affe12b9e9e9c655a7ba6d51b311f02d688e9f1c9a91394a03103f1c0cd5",
}, },
.zgui = .{
.url = "https://git.musuka.dev/paoda/zgui/archive/28e926748b8f302dd4e2902835e392c9b87ea3c6.tar.gz",
.hash = "1220dbf1d809d07d1910b9853f162458ed1ebc66be81b21ccfc40a2552bc1019f9c2",
},
}, },
} }

@ -1 +1 @@
Subproject commit cd902129b7ab571693892c72bbf4e2fb58658730 Subproject commit 0f74e59f4b258868959104b24fdf6c43071e11ad

@ -1 +0,0 @@
Subproject commit 1fff275f8d322d44355a08f2eac3e7c4905fc382