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 - Mac: VIDEO_METAL/VIDEO_VULKAN options cannot be enabled using CMake
Summary: Mac: VIDEO_METAL/VIDEO_VULKAN options cannot be enabled using CMake
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: don't know
Hardware: x86_64 macOS 10.15
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.14
: 5204 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-02-16 13:31 UTC by kvryonides
Modified: 2020-09-15 02:04 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***