Skip to content

Commit

Permalink
fixed: workflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
dinau committed Jun 13, 2024
1 parent e027076 commit e5a191c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/zig_glfw_opengl3/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
//---------------
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e5a191c

Please sign in to comment.