Description
Current Behavior
When building Cemu on Mac, the build with default settings is not able to launch games, while the bundled (option -DMACOS_BUNDLE=ON
) is. I looked through the logs and found this:
[18:02:47.090] Vulkan loader not available.
[18:02:49.817] Vulkan cant list devices because Vulkan loader failed
It looks like the MoltenVK library is not able to be found. I looked to find what the bundle does differently and found this:
Lines 109 to 114 in f801fc1
This copies the
libMoltenVK
dylib into the Frameworks directory, and adds the directory to the runtime path.
So far, I've tried adding
find_library(MOLTENVK_LIB MoltenVK)
if(MOLTENVK_LIB)
target_link_libraries(CemuCafe PRIVATE ${MOLTENVK_LIB})
endif()
to this block, as well as setting LDFLAGS
to -L/opt/homebrew/opt/molten-vk/lib -lMoltenVK
, and confirmed with otool
that the dylib appears in the load commands:
Load command 13
cmd LC_LOAD_DYLIB
cmdsize 80
name /opt/homebrew/opt/molten-vk/lib/libMoltenVK.dylib (offset 24)
time stamp 2 Wed Dec 31 16:00:02 1969
current version 1.0.0
compatibility version 1.0.0
However, this still has not worked.
The following workarounds have succeeded:
- Using the app bundle with
-DMACOS_BUNDLE=ON
- Adding a new runtime path to the binary with
install_name_tool -add_rpath /opt/homebrew/lib bin/Cemu_release
- Symlinking the dylib into the existing rpath:
ln -s /opt/homebrew/Cellar/molten-vk/1.3.0/lib/libMoltenVK.dylib build/vcpkg_installed/arm64-osx/lib/
Any ideas for a way to resolve this through cmake instead of manually?
Expected Behavior
The Mac non-bundle build should be able to launch games with the Vulkan renderer
Steps to Reproduce
- Follow the macOS build steps: https://github.com/cemu-project/Cemu/blob/main/BUILD.md#build-cemu-using-cmake
- Launch the
./bin/Cemu_release
executable - Navigate to Options->General Settings->Graphics and observe the only available Graphics API is OpenGL
System Info (Optional)
OS: macOS 15.4.1
GPU: Apple M4
Emulation Settings (Optional)
No response