cmake/sdlchecks.cmake
changeset 8244 bfea1a568a0a
parent 8159 427e8fdf6f69
child 8991 13b0df1793e8
equal deleted inserted replaced
8243:f905dd0f0f83 8244:bfea1a568a0a
   554 # Requires:
   554 # Requires:
   555 # - n/a
   555 # - n/a
   556 #
   556 #
   557 macro(CheckCOCOA)
   557 macro(CheckCOCOA)
   558   if(VIDEO_COCOA)
   558   if(VIDEO_COCOA)
   559     check_objc_source_compiles("
   559     if(APPLE) # Apple always has Cocoa.
   560         #import <Cocoa/Cocoa.h>
   560       set(HAVE_VIDEO_COCOA TRUE)
   561         int main (int argc, char** argv) {}" HAVE_VIDEO_COCOA)
   561     endif(APPLE)
   562     if(HAVE_VIDEO_COCOA)
   562     if(HAVE_VIDEO_COCOA)
   563       file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m)
   563       file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m)
   564       set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C)
   564       set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C)
   565       set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES})
   565       set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES})
   566       set(SDL_VIDEO_DRIVER_COCOA 1)
   566       set(SDL_VIDEO_DRIVER_COCOA 1)