From a9d784817245d0b0a5f4ab781944342425876fbf Mon Sep 17 00:00:00 2001 From: Th3T3chn0G1t Date: Tue, 28 Jun 2022 12:31:56 +0100 Subject: [PATCH] Fixed macOS and Linux builds to work with Hazel patches --- premake5.lua | 23 +++++++++++++++++++++++ src/cocoa_init.m | 6 +++++- src/x11_init.c | 4 ++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/premake5.lua b/premake5.lua index ed7ce228..d6bb8da2 100644 --- a/premake5.lua +++ b/premake5.lua @@ -39,6 +39,7 @@ project "GLFW" "src/xkb_unicode.c", "src/posix_time.c", "src/posix_thread.c", + "src/posix_module.c", "src/glx_context.c", "src/egl_context.c", "src/osmesa_context.c", @@ -50,6 +51,28 @@ project "GLFW" "_GLFW_X11" } + filter "system:macosx" + pic "On" + + files + { + "src/cocoa_init.m", + "src/cocoa_monitor.m", + "src/cocoa_window.m", + "src/cocoa_joystick.m", + "src/cocoa_time.c", + "src/nsgl_context.m", + "src/posix_thread.c", + "src/posix_module.c", + "src/osmesa_context.c", + "src/egl_context.c" + } + + defines + { + "_GLFW_COCOA" + } + filter "system:windows" systemversion "latest" diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 48bc2c29..5c0c4e82 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -543,13 +543,17 @@ GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform) _glfwGetWindowOpacityCocoa, _glfwSetWindowResizableCocoa, _glfwSetWindowDecoratedCocoa, - _glfwSetWindowFloatingCocoa, + _glfwSetWindowFloatingNull, _glfwSetWindowOpacityCocoa, _glfwSetWindowMousePassthroughCocoa, _glfwPollEventsCocoa, _glfwWaitEventsCocoa, _glfwWaitEventsTimeoutCocoa, _glfwPostEmptyEventCocoa, + + // Hazel + _glfwSetWindowTitlebarNull, + _glfwGetEGLPlatformCocoa, _glfwGetEGLNativeDisplayCocoa, _glfwGetEGLNativeWindowCocoa, diff --git a/src/x11_init.c b/src/x11_init.c index acfa7933..a4e72a28 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -1204,6 +1204,10 @@ GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform) _glfwWaitEventsX11, _glfwWaitEventsTimeoutX11, _glfwPostEmptyEventX11, + + // Hazel + _glfwSetWindowTitlebarNull, + _glfwGetEGLPlatformX11, _glfwGetEGLNativeDisplayX11, _glfwGetEGLNativeWindowX11,