diff --git a/CMakeLists.txt b/CMakeLists.txt index fbd23510b..414b1a04b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,6 @@ include(CheckIncludeFiles) include(CheckIncludeFile) include(CheckSymbolExists) include(CheckCSourceCompiles) -include(CheckOBJCSourceCompiles) include(CheckCSourceRuns) include(CheckCCompilerFlag) include(CheckTypeSize) @@ -1802,7 +1801,9 @@ elseif(APPLE) endif() if(VIDEO_VULKAN OR VIDEO_METAL OR RENDER_METAL) - check_objc_source_compiles(" + set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "-x objective-c ${CMAKE_REQUIRED_FLAGS}") + check_c_source_compiles(" #include #import #import @@ -1812,8 +1813,10 @@ elseif(APPLE) #endif int main() { + return 0; } " HAVE_FRAMEWORK_METAL) + set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) if(HAVE_FRAMEWORK_METAL) set(SDL_FRAMEWORK_METAL 1) set(SDL_FRAMEWORK_QUARTZCORE 1)