only enable metal on apple platforms by default

This commit is contained in:
Samuliak 2024-09-28 11:51:50 +02:00
parent 3cf831d46a
commit 3de2b0325b
2 changed files with 51 additions and 46 deletions

View File

@ -103,11 +103,20 @@ if (UNIX AND NOT APPLE)
option(ENABLE_FERAL_GAMEMODE "Enables Feral Interactive GameMode Support" ON)
endif()
if (APPLE)
set(ENABLE_METAL_DEFAULT ON)
else()
set(ENABLE_METAL_DEFAULT OFF)
endif()
option(ENABLE_OPENGL "Enables the OpenGL backend" ON)
option(ENABLE_VULKAN "Enables the Vulkan backend" ON)
option(ENABLE_METAL "Enables the Metal backend" ON)
option(ENABLE_METAL "Enables the Metal backend" $ENABLE_METAL_DEFAULT)
option(ENABLE_DISCORD_RPC "Enables the Discord Rich Presence feature" ON)
if (ENABLE_METAL AND NOT APPLE)
message(FATAL_ERROR "Metal backend is only supported on Apple platforms")
endif()
# input backends
if (WIN32)

View File

@ -534,7 +534,6 @@ if(APPLE)
endif()
if(ENABLE_METAL)
if(APPLE)
target_sources(CemuCafe PRIVATE
HW/Latte/Renderer/Metal/MetalRenderer.cpp
HW/Latte/Renderer/Metal/MetalRenderer.h
@ -577,9 +576,6 @@ if(ENABLE_METAL)
# "-framework Metal"
# "-framework QuartzCore"
#)
else()
message(FATAL_ERROR "Metal is only supported on macOS")
endif()
endif()
set_property(TARGET CemuCafe PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")