glfw: add Windows x86_64 support

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2021-07-25 22:30:20 -07:00 committed by Stephen Gutekanst
parent c4470e1a14
commit 45125bec55

View file

@ -71,7 +71,7 @@ pub fn link(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void
var abs_path = std.fs.path.join(&arena.allocator, &.{ thisDir(), path }) catch unreachable; var abs_path = std.fs.path.join(&arena.allocator, &.{ thisDir(), path }) catch unreachable;
sources.append(abs_path) catch unreachable; sources.append(abs_path) catch unreachable;
} }
lib.addCSourceFiles(sources.items, &.{}); lib.addCSourceFiles(sources.items, &.{"-D_GLFW_WIN32"});
}, },
.macos => { .macos => {
includeSdkMacOS(b, lib); includeSdkMacOS(b, lib);
@ -174,8 +174,14 @@ fn linkGLFW(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target; const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target;
switch (target.os.tag) { switch (target.os.tag) {
.windows => { .windows => {
// TODO(slimsag): create sdk-windows
step.linkSystemLibrary("c"); step.linkSystemLibrary("c");
step.linkSystemLibrary("gdi32");
if (options.opengl) {
step.linkFramework("opengl32");
}
if (options.gles) {
step.linkFramework("GLESv2");
}
}, },
.macos => { .macos => {
includeSdkMacOS(b, step); includeSdkMacOS(b, step);