We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4988

Summary: Mac: VIDEO_METAL/VIDEO_VULKAN options cannot be enabled using CMake
Product: SDL Reporter: kvryonides
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus, lassi
Version: don't knowKeywords: target-2.0.14
Hardware: x86_64   
OS: macOS 10.15   

Description kvryonides 2020-02-16 13:31:54 UTC
I am trying to build the latest source from the default branch and I am using MacOS Catalina version 10.15.3 (19D76).

Compiling SDL2 using CMake and setting options VIDEO_METAL/VIDEO_VULKAN to ON fails to enable them. Building SDL2 2.0.10 from source works correctly and Metal/Vulkan support is enabled.

The relevant output I get from CMake is the following:
-- Performing Test HAVE_FRAMEWORK_METAL
-- Performing Test HAVE_FRAMEWORK_METAL - Failed

--   VIDEO_METAL            (Wanted: 0): OFF
--   VIDEO_VULKAN           (Wanted: 0): OFF

When using /.configure, I think it works correctly although I have not tried to build and link against it because I can see it print the following at the end:

Video drivers   : dummy cocoa metal opengl opengl_es2 vulkan

I believe I have tracked the issue to potentially this line and commit: https://hg.libsdl.org/SDL/rev/b87ba0fad17e#l1.44

My assumption is that check_c_source_compiles() fails to compile the provided  input because it is an objective-c source (for example using #import)and not a c source.
Comment 1 Ryan C. Gordon 2020-06-27 06:03:39 UTC
This is fixed in https://hg.libsdl.org/SDL/rev/e7828d3a7576

--ryan.
Comment 2 lassi 2020-09-15 02:04:44 UTC
*** Bug 5204 has been marked as a duplicate of this bug. ***