From b32b27ae9a4ab7e76a4ba9c5073d3c33c7b5b1a4 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sat, 23 Jul 2022 04:30:48 -0400 Subject: [PATCH] MTLMain: Only compile NSView manipulation code on macOS --- Source/Core/VideoBackends/Metal/MTLMain.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Core/VideoBackends/Metal/MTLMain.mm b/Source/Core/VideoBackends/Metal/MTLMain.mm index f294f297f2..18e800e547 100644 --- a/Source/Core/VideoBackends/Metal/MTLMain.mm +++ b/Source/Core/VideoBackends/Metal/MTLMain.mm @@ -3,7 +3,10 @@ #include "VideoBackends/Metal/VideoBackend.h" +#if TARGET_OS_OSX #include +#endif + #include #include @@ -156,6 +159,7 @@ void Metal::VideoBackend::InitBackendInfo() void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi) { +#if TARGET_OS_OSX if (wsi.type != WindowSystemType::MacOS) return; NSView* view = static_cast(wsi.render_surface); @@ -163,4 +167,5 @@ void Metal::VideoBackend::PrepareWindow(WindowSystemInfo& wsi) [view setWantsLayer:YES]; [view setLayer:layer]; wsi.render_surface = layer; +#endif }