diff --git a/glfw/build.zig b/glfw/build.zig index d9b00574..0ee9e56a 100644 --- a/glfw/build.zig +++ b/glfw/build.zig @@ -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, diff --git a/glfw/src/sources_all.c b/glfw/src/sources_all.c index 31a3de1d..fad5a98e 100644 --- a/glfw/src/sources_all.c +++ b/glfw/src/sources_all.c @@ -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" diff --git a/glfw/src/sources_linux.c b/glfw/src/sources_linux.c index efe14f5a..7b54172d 100644 --- a/glfw/src/sources_linux.c +++ b/glfw/src/sources_linux.c @@ -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" \ No newline at end of file +#include "xkb_unicode.c" +#include "posix_module.c" +#include "posix_poll.c" diff --git a/glfw/src/sources_macos.c b/glfw/src/sources_macos.c index 65dc1d15..273abc4c 100644 --- a/glfw/src/sources_macos.c +++ b/glfw/src/sources_macos.c @@ -1,5 +1,4 @@ -#include "sources_all.c" - // MacOS-specific sources #include "cocoa_time.c" #include "posix_thread.c" +#include "posix_module.c" diff --git a/glfw/src/sources_windows.c b/glfw/src/sources_windows.c index 2b49ceed..7fd711f3 100644 --- a/glfw/src/sources_windows.c +++ b/glfw/src/sources_windows.c @@ -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"