Skip to content

Commit 71e06a5

Browse files
ericwaicculus
authored andcommitted
cmake: fix Metal detection
Confirmed to work on: macOS 10.15.7 XCode Version 12.4 (12D4e)
1 parent 8ceba27 commit 71e06a5

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,21 +1992,15 @@ elseif(APPLE)
19921992
endif()
19931993

19941994
if(SDL_VULKAN OR SDL_METAL OR SDL_RENDER_METAL)
1995-
set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
1996-
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -ObjC")
1997-
check_c_source_compiles("
1995+
check_objc_source_compiles("
19981996
#include <AvailabilityMacros.h>
19991997
#import <Metal/Metal.h>
20001998
#import <QuartzCore/CAMetalLayer.h>
20011999
20022000
#if (!TARGET_CPU_X86_64 && !TARGET_CPU_ARM64)
20032001
#error Metal doesn't work on this configuration
20042002
#endif
2005-
int main(void) {
2006-
return 0;
2007-
}
2008-
" HAVE_FRAMEWORK_METAL)
2009-
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
2003+
int main(void) {}" HAVE_FRAMEWORK_METAL)
20102004
if(HAVE_FRAMEWORK_METAL)
20112005
set(SDL_FRAMEWORK_METAL 1)
20122006
set(SDL_FRAMEWORK_QUARTZCORE 1)

0 commit comments

Comments
 (0)