diff --git a/libs/glfw/build.zig b/libs/glfw/build.zig index 0835497b..e9453bf5 100644 --- a/libs/glfw/build.zig +++ b/libs/glfw/build.zig @@ -116,6 +116,7 @@ fn buildLibrary(b: *Build, optimize: std.builtin.OptimizeMode, target: std.zig.C fn addGLFWIncludes(step: *std.build.CompileStep) void { step.addIncludePath(sdkPath("/upstream/glfw/include")); step.addIncludePath(sdkPath("/upstream/vulkan_headers/include")); + step.addIncludePath(sdkPath("/src")); } fn addGLFWSources(b: *Build, lib: *std.build.CompileStep, options: Options) std.mem.Allocator.Error!void { diff --git a/libs/glfw/src/glfw_native.h b/libs/glfw/src/glfw_native.h new file mode 100644 index 00000000..fe6c9a0a --- /dev/null +++ b/libs/glfw/src/glfw_native.h @@ -0,0 +1,5 @@ +// MacOS: this must be defined for system-sdk-13.3 and older. +#define __kernel_ptr_semantics + +#include +#include diff --git a/libs/glfw/src/native.zig b/libs/glfw/src/native.zig index 392f60ff..51e1fb99 100644 --- a/libs/glfw/src/native.zig +++ b/libs/glfw/src/native.zig @@ -40,7 +40,6 @@ pub const BackendOptions = struct { pub fn Native(comptime options: BackendOptions) type { const native = @cImport({ @cDefine("GLFW_INCLUDE_VULKAN", "1"); - @cInclude("GLFW/glfw3.h"); if (options.win32) @cDefine("GLFW_EXPOSE_NATIVE_WIN32", "1"); if (options.wgl) @cDefine("GLFW_EXPOSE_NATIVE_WGL", "1"); if (options.cocoa) @cDefine("GLFW_EXPOSE_NATIVE_COCOA", "1"); @@ -50,7 +49,7 @@ pub fn Native(comptime options: BackendOptions) type { if (options.wayland) @cDefine("GLFW_EXPOSE_NATIVE_WAYLAND", "1"); if (options.egl) @cDefine("GLFW_EXPOSE_NATIVE_EGL", "1"); if (options.osmesa) @cDefine("GLFW_EXPOSE_NATIVE_OSMESA", "1"); - @cInclude("GLFW/glfw3native.h"); + @cInclude("glfw_native.h"); }); return struct {