cmake/sdlchecks.cmake
changeset 7182 1089a8a701c3
parent 7078 a2bddc1fb02f
child 7266 6caad66a4966
equal deleted inserted replaced
7181:d35a0936c674 7182:1089a8a701c3
   447 # Requires:
   447 # Requires:
   448 # - n/a
   448 # - n/a
   449 #
   449 #
   450 macro(CheckCOCOA)
   450 macro(CheckCOCOA)
   451   if(VIDEO_COCOA)
   451   if(VIDEO_COCOA)
   452     check_c_source_compiles("
   452     check_objc_source_compiles("
   453         #import <Cocoa/Cocoa.h>
   453         #import <Cocoa/Cocoa.h>
   454         int main (int argc, char** argv) {}" HAVE_VIDEO_COCOA)
   454         int main (int argc, char** argv) {}" HAVE_VIDEO_COCOA)
   455     if(HAVE_VIDEO_COCOA)
   455     if(HAVE_VIDEO_COCOA)
   456       file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m)
   456       file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m)
       
   457       set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C)
   457       set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES})
   458       set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES})
   458       set(SDL_VIDEO_DRIVER_COCOA 1)
   459       set(SDL_VIDEO_DRIVER_COCOA 1)
   459       set(HAVE_SDL_VIDEO TRUE)
   460       set(HAVE_SDL_VIDEO TRUE)
   460     endif(HAVE_VIDEO_COCOA)
   461     endif(HAVE_VIDEO_COCOA)
   461   endif(VIDEO_COCOA)
   462   endif(VIDEO_COCOA)