chore: Update to Zig v0.11.0

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-08-06 22:36:51 +01:00
parent 1fa5c9675f
commit 2e4f8d1409
1 changed files with 11 additions and 5 deletions

View File

@ -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 => {},
}