glfw: update build system to glfw@master

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-06-11 15:44:27 -07:00 committed by Stephen Gutekanst
parent ab26356574
commit e24a0c4ce9
5 changed files with 16 additions and 8 deletions

View file

@ -66,8 +66,12 @@ fn buildLibrary(b: *Builder, step: *std.build.LibExeObjStep, options: Options) *
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target;
const include_glfw_src = "-I" ++ thisDir() ++ "/upstream/glfw/src";
switch (target.os.tag) {
.windows => lib.addCSourceFile(thisDir() ++ "/src/sources_windows.c", &.{ "-D_GLFW_WIN32", include_glfw_src }),
.windows => lib.addCSourceFiles(&.{
thisDir() ++ "/src/sources_all.c",
thisDir() ++ "/src/sources_windows.c",
}, &.{ "-D_GLFW_WIN32", include_glfw_src }),
.macos => lib.addCSourceFiles(&.{
thisDir() ++ "/src/sources_all.c",
thisDir() ++ "/src/sources_macos.m",
thisDir() ++ "/src/sources_macos.c",
}, &.{ "-D_GLFW_COCOA", include_glfw_src }),
@ -86,6 +90,7 @@ fn buildLibrary(b: *Builder, step: *std.build.LibExeObjStep, options: Options) *
.X11 => "-D_GLFW_X11",
.Wayland => "-D_GLFW_WAYLAND",
};
sources.append(thisDir() ++ "/src/sources_all.c") catch unreachable;
sources.append(thisDir() ++ "/src/sources_linux.c") catch unreachable;
switch (options.linux_window_manager) {
.X11 => sources.append(thisDir() ++ "/src/sources_linux_x11.c") catch unreachable,

View file

@ -7,3 +7,8 @@
#include "egl_context.c"
#include "context.c"
#include "window.c"
#include "platform.c"
#include "null_init.c"
#include "null_monitor.c"
#include "null_window.c"
#include "null_joystick.c"

View file

@ -1,7 +1,7 @@
#include "sources_all.c"
// General Linux-like sources
#include "posix_time.c"
#include "posix_thread.c"
#include "linux_joystick.c"
#include "xkb_unicode.c"
#include "posix_module.c"
#include "posix_poll.c"

View file

@ -1,5 +1,4 @@
#include "sources_all.c"
// MacOS-specific sources
#include "cocoa_time.c"
#include "posix_thread.c"
#include "posix_module.c"

View file

@ -1,5 +1,3 @@
#include "sources_all.c"
// Windows-specific sources
#include "win32_thread.c"
#include "wgl_context.c"
@ -8,3 +6,4 @@
#include "win32_time.c"
#include "win32_joystick.c"
#include "win32_window.c"
#include "win32_module.c"