Simple Directmedia Layer
Go to file
Sam Lantinga 4b35a18d8b Fixed bug 5366 - cmake build doesn't detect Metal on macOS
Tom Seddon

This is as of commit 50d804ea729accf9e3a9ce83238d0a2976a17545 from https://github.com/SDL-mirror/SDL, which is HEAD as I write (apologies, not confident with Mercurial)

# Config

macOS: 10.14.6 (18G6042)
cmake --version: cmake version 3.16.20200101-g23e782c
clang --version: Apple clang version 11.0.0 (clang-1100.0.33.17)
Xcode version: Version 11.3.1 (11C504)

# Repro steps

Run the following commands in the shell.

 cd /tmp/
 git clone https://github.com/SDL-mirror/SDL
 mkdir build.SDL
 cd build.SDL
 cmake -G ../SDL/

Examine cmake output.

# Expected result

Metal is detected.

# Actual result

It appears that Metal is not detected! Note this line in the summary:

 --   RENDER_METAL           (Wanted: 0): OFF

# Fix

Change check_c_source_compiles to check_objc_source_compiles. The cmake script tries to add -ObjC to the clang command line, but, for whatever reason, this doesn't seem to work.

Change the test source to have an empty main. The "return 0;" line seems to confuse cmake somehow, causing it to crap out with an error about HAVE_FRAMEWORK_METAL being an unknown argument. (Maybe I'm just dense, but it's not obvious to me what the problem is here.)

With these two changes:

 --   RENDER_METAL           (Wanted: ON): ON

Patch attached.
2020-12-01 13:50:42 -08:00
acinclude
android-project Android: keep compatibility with older JDK 2020-10-28 14:03:05 +01:00
android-project-ant
build-scripts
cmake
debian
docs added documentation docs/README-os2.md (based on original readme.os2). 2020-10-14 23:01:06 +03:00
include Moved raw input event processing from the main thread to the joystick thread 2020-11-27 13:08:40 -08:00
src Fixed bug 5371 - Rawinput: Fix truncating cast of string length. 2020-12-01 13:38:42 -08:00
test Remember to close the game controller when we're done with it 2020-11-27 18:57:42 -08:00
VisualC Generalized the raw input controller driver and moved XInput/WGI detection into it for XInput devices 2020-11-23 18:24:05 -08:00
VisualC-WinRT Added SDL_crc32.c to the Windows RT projects 2020-11-16 17:42:04 -08:00
visualtest
wayland-protocols
Xcode Fixed bug 5367 - SDL_OpenUrl disabled on iOS due to unified Xcode project file 2020-12-01 13:46:34 -08:00
Xcode-iOS Added weak linking to hidapi framework 2020-11-17 10:29:36 -08:00
.hgignore
Android.mk minor whitespace fix 2020-10-09 03:28:30 +03:00
autogen.sh
BUGS.txt
cmake_uninstall.cmake.in
CMakeLists.txt Fixed bug 5366 - cmake build doesn't detect Metal on macOS 2020-12-01 13:50:42 -08:00
configure Added SDL_wcscasecmp() and SDL_wcsncasecmp() 2020-11-24 12:43:01 -08:00
configure.ac Added SDL_wcscasecmp() and SDL_wcsncasecmp() 2020-11-24 12:43:01 -08:00
COPYING.txt
CREDITS.txt
INSTALL.txt
Makefile.in Updated iOS tests and demos for latest SDL linking requirements 2020-11-06 13:03:07 -08:00
Makefile.minimal
Makefile.os2 fix os/2 build 2020-11-17 02:39:56 +03:00
Makefile.pandora
Makefile.psp
Makefile.wiz
README-SDL.txt
README.txt
sdl2-config-version.cmake.in
sdl2-config.cmake.in
sdl2-config.in
sdl2.m4
sdl2.pc.in
SDL2.spec.in
SDL2Config.cmake
TODO.txt
VisualC.html
WhatsNew.txt

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)