From 2771b709ea66c1b15437a69a6b4d6ba97c82b0f7 Mon Sep 17 00:00:00 2001 From: secrart <79920995+secrart@users.noreply.github.com> Date: Mon, 13 Jun 2022 23:12:17 -0400 Subject: [PATCH] Add CMake options for metal support metal support is fully optional now updated README with changelog --- README.md | 2 ++ src/CMakeLists.txt | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 86d66f8d..6958f183 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,8 @@ information on what to include when reporting a bug. ## Changelog + - Added `GLFW_USE_METALKIT` to cmake build options to make metal support optional + - [Cocoa] Added `glfwResetCocoaMTKFramesize` function for metal view resizing - [Cocoa] Added `glfwAddCocoaMTKSubview` function for better metal support - Added `GLFW_PLATFORM` init hint for runtime platform selection (#1958) - Added `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 030f4e1c..5bcb5993 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -164,6 +164,15 @@ if (GLFW_BUILD_COCOA) "-framework IOKit" "-framework CoreFoundation") + if(GLFW_USE_METALKIT) + + target_link_libraries(glfw PRIVATE "-framework Metal" + "-framework MetalKit") + + endif() + + + set(glfw_PKG_DEPS "") set(glfw_PKG_LIBS "-framework Cocoa -framework IOKit -framework CoreFoundation") endif()