From 2e4f8d1409ffbf957d5edaa080492e1b50ac059f Mon Sep 17 00:00:00 2001 From: paoda Date: Sun, 6 Aug 2023 22:36:51 +0100 Subject: [PATCH] chore: Update to Zig v0.11.0 --- build.zig | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index 1d0e1dc..79f6b28 100644 --- a/build.zig +++ b/build.zig @@ -112,8 +112,10 @@ pub fn package( }, cflags); }, .glfw_opengl3 => { - zgui_c_cpp.addCSourceFile(thisDir() ++ "/libs/imgui/backends/imgui_impl_glfw.cpp", cflags); - zgui_c_cpp.addCSourceFile(thisDir() ++ "/libs/imgui/backends/imgui_impl_opengl3.cpp", cflags); + zgui_c_cpp.addCSourceFiles(&.{ + thisDir() ++ "/libs/imgui/backends/imgui_impl_glfw.cpp", + thisDir() ++ "/libs/imgui/backends/imgui_impl_opengl3.cpp", + }, cflags); }, .win32_dx12 => { zgui_c_cpp.addCSourceFiles(&.{ @@ -135,7 +137,9 @@ pub fn package( defer b.allocator.free(vcpkg_triplet); const include_path = b.pathJoin(&.{ b.vcpkg_root.found, "installed", vcpkg_triplet, "include", "SDL2" }); - zgui_c_cpp.include_dirs.append(.{ .raw_path = include_path }) catch @panic("out of memory"); + + // What's the difference between a IncludeDir "path" and "path_system"? + zgui_c_cpp.include_dirs.append(.{ .path = .{ .path = include_path } }) catch @panic("out of memory"); const bin_path = zgui_c_cpp.vcpkg_bin_path orelse @panic("vcpkg paths were found, so vcpkg_bin_path should be set "); const dll_path = std.fs.path.join(b.allocator, &.{ bin_path, "SDL2.dll" }) catch @panic("out of memory"); @@ -146,8 +150,10 @@ pub fn package( 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); + zgui_c_cpp.addCSourceFiles(&.{ + thisDir() ++ "/libs/imgui/backends/imgui_impl_sdl.cpp", + thisDir() ++ "/libs/imgui/backends/imgui_impl_opengl3.cpp", + }, cflags); }, .no_backend => {}, }