1
0
Fork 0
forked from suyu/suyu

metal: make metal-cpp a proper external

This commit is contained in:
Exverge 2024-04-06 21:13:26 -04:00
parent 76009b05a8
commit c3584e6c39
Signed by: Exverge
GPG key ID: 19AAFC0AC6A9B35A
5 changed files with 19 additions and 20 deletions

View file

@ -320,3 +320,9 @@ if (ARCHITECTURE_arm64 AND NOT TARGET sse2neon)
add_library(sse2neon INTERFACE)
target_include_directories(sse2neon INTERFACE sse2neon)
endif()
# metal-cpp
if (APPLE)
add_library(metal-cpp INTERFACE)
target_include_directories(metal-cpp INTERFACE metal-cpp)
endif()

View file

@ -184,11 +184,6 @@ else()
endif()
endif()
if (APPLE)
# TODO: use target_link_libraries
include_directories(${CMAKE_SOURCE_DIR}/externals/metal-cpp)
endif()
add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(audio_core)

View file

@ -42,8 +42,12 @@ target_include_directories(suyu-cmd PRIVATE ${RESOURCES_DIR})
target_link_libraries(suyu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers)
if(UNIX AND NOT APPLE)
install(TARGETS suyu-cmd)
if(UNIX)
if (APPLE)
target_link_libraries(suyu-cmd PRIVATE metal-cpp)
else()
install(TARGETS suyu-cmd)
endif()
endif()
if(WIN32)

View file

@ -17,7 +17,7 @@
EmuWindow_SDL2_MTL::EmuWindow_SDL2_MTL(InputCommon::InputSubsystem* input_subsystem_,
Core::System& system_, bool fullscreen)
: EmuWindow_SDL2{input_subsystem_, system_} {
const std::string window_title = fmt::format("suyu {} | {}-{} (Vulkan)", Common::g_build_name,
const std::string window_title = fmt::format("suyu {} | {}-{} (Metal)", Common::g_build_name,
Common::g_scm_branch, Common::g_scm_desc);
render_window =
SDL_CreateWindow(window_title.c_str(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
@ -39,18 +39,8 @@ EmuWindow_SDL2_MTL::EmuWindow_SDL2_MTL(InputCommon::InputSubsystem* input_subsys
ShowCursor(false);
}
switch (wm.subsystem) {
#ifdef SDL_VIDEO_DRIVER_COCOA
case SDL_SYSWM_TYPE::SDL_SYSWM_COCOA:
window_info.type = Core::Frontend::WindowSystemType::Cocoa;
window_info.render_surface = SDL_Metal_CreateView(render_window);
break;
#endif
default:
LOG_CRITICAL(Frontend, "Window manager subsystem {} not implemented", wm.subsystem);
std::exit(EXIT_FAILURE);
break;
}
window_info.type = Core::Frontend::WindowSystemType::Cocoa;
window_info.render_surface = SDL_Metal_CreateView(render_window);
OnResize();
OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size);

View file

@ -405,6 +405,10 @@ add_dependencies(video_core host_shaders)
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator)
if (APPLE)
target_link_libraries(video_core PRIVATE metal-cpp)
endif()
if (ENABLE_NSIGHT_AFTERMATH)
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
message(FATAL_ERROR "Environment variable NSIGHT_AFTERMATH_SDK has to be provided")