From e5a191ca5068328366d62882d6d65286b967e0b7 Mon Sep 17 00:00:00 2001 From: dinau Date: Thu, 13 Jun 2024 15:01:56 +0900 Subject: [PATCH] fixed: workflow error --- examples/zig_glfw_opengl3/build.zig | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/zig_glfw_opengl3/build.zig b/examples/zig_glfw_opengl3/build.zig index 4385689..b10376c 100644 --- a/examples/zig_glfw_opengl3/build.zig +++ b/examples/zig_glfw_opengl3/build.zig @@ -47,12 +47,13 @@ pub fn build(b: *std.Build) void { //---------------------------------- // Detect 32bit or 64bit Winddws OS //---------------------------------- - const glfw_base = "../../libs/glfw/glfw-3.3.9.bin.WIN"; + var sBuf: [2048]u8 = undefined; + const Glfw_Base = "../../libs/glfw/glfw-3.3.9.bin.WIN"; var sArc = "64"; if(builtin.cpu.arch == std.Target.Cpu.Arch.x86){ sArc = "32"; } - const glfw_path = b.pathJoin(&.{glfw_base, sArc}); + const glfw_path = std.fmt.bufPrint(&sBuf, "{s}{s}", .{Glfw_Base,sArc}) catch unreachable; //--------------- // Include paths //--------------- @@ -102,8 +103,12 @@ pub fn build(b: *std.Build) void { exe.linkSystemLibrary("user32"); exe.linkSystemLibrary("shell32"); // GLFW - exe.addLibraryPath(.{ .path = b.pathJoin(&.{glfw_path, "lib-vc2019"})}); - exe.linkSystemLibrary("glfw3"); // For static link + //exe.addLibraryPath(.{.path = b.pathJoin(&.{glfw_path, "lib-mingw-64"})}); + //exe.linkSystemLibrary("glfw3"); // For static link + // Static link + exe.addObjectFile(.{.path = b.pathJoin(&.{glfw_path, "lib-mingw-w64","libglfw3.a"})}); + // Dynamic link + //exe.addObjectFile(.{.path = b.pathJoin(&.{glfw_path, "lib-mingw-w64","libglfw3dll.a"})}); //exe.linkSystemLibrary("glfw3dll"); // For dynamic link // System exe.linkLibC();