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.
This commit is contained in:
Wunkolo 2026-06-04 12:36:58 -07:00 committed by OpenSauce
parent c03248f158
commit 8e0dea381e

View file

@ -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)