Fixed bug 3786 - building against a Mac OS X SDK < 10.11 fails since the vulkan merge Ozkan Sezer Since the Vulkan merge, building against a Mac OS X SDM older than 10.11 fails in SDL_cocoametalview.m because Metal.framework is not present. There is no conditional compiling in SDL_cocoametalview.m either, so --disable-video-vulkan doesn't help with anything. (The configury doesn't check darwin for x86_64 either, but it's another story.) I cross-build against 10.8 SDK on linux using clang-3.4.2 and this is a problem for me. Will this be fixed?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/src/video/cocoa/SDL_cocoametalview.h b/src/video/cocoa/SDL_cocoametalview.h
index 039830b..75751c0 100644
--- a/src/video/cocoa/SDL_cocoametalview.h
+++ b/src/video/cocoa/SDL_cocoametalview.h
@@ -32,6 +32,8 @@
#import "../SDL_sysvideo.h"
#import "SDL_cocoawindow.h"
+#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA
+
#import <Cocoa/Cocoa.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
@@ -55,6 +57,8 @@ SDL_cocoametalview* Cocoa_Mtl_AddMetalView(SDL_Window* window);
void Cocoa_Mtl_GetDrawableSize(SDL_Window * window, int * w, int * h);
+#endif /* SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA */
+
#endif /* SDL_cocoametalview_h_ */
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/cocoa/SDL_cocoametalview.m b/src/video/cocoa/SDL_cocoametalview.m
index f1d0f6c..8813815 100644
--- a/src/video/cocoa/SDL_cocoametalview.m
+++ b/src/video/cocoa/SDL_cocoametalview.m
@@ -28,6 +28,8 @@
#import "SDL_cocoametalview.h"
+#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA
+
#include "SDL_assert.h"
#include "SDL_loadso.h"
#include <dlfcn.h>
@@ -116,5 +118,6 @@ Cocoa_Mtl_GetDrawableSize(SDL_Window * window, int * w, int * h)
}
}
-/* vi: set ts=4 sw=4 expandtab: */
+#endif /* SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA */
+/* vi: set ts=4 sw=4 expandtab: */