From 8e0dea381eaf8e89caf47602efbd31a475f4401f Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Thu, 4 Jun 2026 12:36:58 -0700 Subject: [PATCH] cmake: Fix MacOS linker errors Resolves some linker issues that I was seeing when trying to build the `azahar-room` target on MacOS. This error seems to only occur on my machines on both `15.6.1` and also after upgrading to `26.5.1`. I am on Xcode version 16.3. Still unsure of why other users and GitHub actions images are able to build the MacOS image just fine, but this seems to unblock the issue for me. --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42664571b..dd09747fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -410,16 +410,19 @@ if (APPLE) find_library(COCOA_LIBRARY Cocoa REQUIRED) endif() find_library(AVFOUNDATION_LIBRARY AVFoundation REQUIRED) + find_library(IOKIT_LIBRARY IOKit REQUIRED) find_library(IOSURFACE_LIBRARY IOSurface REQUIRED) - set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${AVFOUNDATION_LIBRARY} ${IOSURFACE_LIBRARY} ${MOLTENVK_LIBRARY}) + find_library(QUARTZCORE_LIBRARY QuartzCore REQUIRED) + set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${AVFOUNDATION_LIBRARY} ${IOSURFACE_LIBRARY} ${IOKIT_LIBRARY} ${MOLTENVK_LIBRARY} ${QUARTZCORE_LIBRARY}) if (ENABLE_VULKAN AND NOT ENABLE_LIBRETRO) if (NOT USE_SYSTEM_MOLTENVK) download_moltenvk() endif() + find_library(MOLTENVK_LIBRARY Metal REQUIRED) find_library(MOLTENVK_LIBRARY MoltenVK REQUIRED) message(STATUS "Using MoltenVK at ${MOLTENVK_LIBRARY}.") - set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${MOLTENVK_LIBRARY}) + set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${MOLTENVK_LIBRARY} ${METAL_LIBRARY}) endif() elseif (WIN32) set(PLATFORM_LIBRARIES winmm ws2_32)