From ca6d7f02a4e74ddb76f7303a7bc6aad09853f9f6 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 10 Mar 2023 22:04:35 -0600 Subject: [PATCH] chore: explicitly link SDL2 TODO: What happens on Windows? macOS? --- build.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build.zig b/build.zig index c849943..3c2db12 100644 --- a/build.zig +++ b/build.zig @@ -105,6 +105,23 @@ pub fn package( zgui_c_cpp.linkSystemLibraryName("dwmapi"); }, .sdl2_opengl3 => { + // if (target.isWindows()) blk: { + // // see: https://github.com/MasterQ32/SDL.zig/blob/37f4ba9e31bea895fa19ef8b90d1f51111e52e67/Sdk.zig#L182-L199 + + // zgui_c_cpp.addVcpkgPaths(if (args.options.shared) .dynamic else .static) catch break :blk; + // const path = zgui_c_cpp.vcpkg_bin_path orelse break :blk; + + // const src_path = std.fs.path.join(b.allocator, &.{ path, "SDL2.dll" }) catch @panic("out of memory"); + + // std.fs.cwd().access(src_path, .{}) catch break :blk; + + // std.log.info("path: {s}", .{src_path}); + // // we found SDL2.dll + // b.installBinFile(src_path, "SDL2.dll"); + // } + + zgui_c_cpp.linkSystemLibrary("SDL2"); + zgui_c_cpp.addCSourceFile(thisDir() ++ "/libs/imgui/backends/imgui_impl_sdl.cpp", cflags); zgui_c_cpp.addCSourceFile(thisDir() ++ "/libs/imgui/backends/imgui_impl_opengl3.cpp", cflags); },