Skip to content

Commit

Permalink
cmake: Fix Metal detection on macOS/iOS.
Browse files Browse the repository at this point in the history
Apparently the "-x objective-c" made it down to the linker, who then treats
the .o file as Objective-C source code.  Apparently the -ObjC argument does
the same thing but gets ignored by the linker.

Fixes Bugzilla #4988.
  • Loading branch information
icculus committed Jun 27, 2020
1 parent 363fd52 commit e294639
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -1742,7 +1742,7 @@ elseif(APPLE)

if(VIDEO_VULKAN OR VIDEO_METAL OR RENDER_METAL)
set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x objective-c")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -ObjC")
check_c_source_compiles("
#include <AvailabilityMacros.h>
#import <Metal/Metal.h>
Expand Down

0 comments on commit e294639

Please sign in to comment.