CMakeLists.txt
changeset 9982 9145e51b15bb
parent 9981 a443c97eb294
child 9994 d3e4f7b44d4d
equal deleted inserted replaced
9981:a443c97eb294 9982:9145e51b15bb
   686     set(HAVE_VIDEO_DUMMY TRUE)
   686     set(HAVE_VIDEO_DUMMY TRUE)
   687     set(HAVE_SDL_VIDEO TRUE)
   687     set(HAVE_SDL_VIDEO TRUE)
   688   endif()
   688   endif()
   689 endif()
   689 endif()
   690 
   690 
       
   691 if(ANDROID)
       
   692   file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
       
   693   set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_CORE_SOURCES})
       
   694   file(GLOB ANDROID_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/android/*.c)
       
   695   set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_MAIN_SOURCES})
       
   696   if(SDL_AUDIO)
       
   697     set(SDL_AUDIO_DRIVER_ANDROID 1)
       
   698     file(GLOB ANDROID_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/android/*.c)
       
   699     set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_AUDIO_SOURCES})
       
   700     set(HAVE_SDL_AUDIO TRUE)
       
   701   endif()
       
   702   if(SDL_FILESYSTEM)
       
   703     set(SDL_FILESYSTEM_ANDROID 1)
       
   704     file(GLOB ANDROID_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/android/*.c)
       
   705     set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_FILESYSTEM_SOURCES})
       
   706     set(HAVE_SDL_FILESYSTEM TRUE)
       
   707   endif()
       
   708   if(SDL_JOYSTICK)
       
   709     set(SDL_JOYSTICK_ANDROID 1)
       
   710     file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c)
       
   711     set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_JOYSTICK_SOURCES})
       
   712     set(HAVE_SDL_JOYSTICK TRUE)
       
   713   endif()
       
   714   if(SDL_POWER)
       
   715     set(SDL_POWER_ANDROID 1)
       
   716     file(GLOB ANDROID_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/android/*.c)
       
   717     set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_POWER_SOURCES})
       
   718     set(HAVE_SDL_POWER TRUE)
       
   719   endif()
       
   720   if(SDL_VIDEO)
       
   721     set(SDL_VIDEO_DRIVER_ANDROID 1)
       
   722     file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
       
   723     set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_VIDEO_SOURCES})
       
   724     set(HAVE_SDL_VIDEO TRUE)
       
   725 
       
   726     #enable gles
       
   727     if(VIDEO_OPENGLES)
       
   728       set(SDL_VIDEO_OPENGL_EGL 1)
       
   729       set(HAVE_VIDEO_OPENGLES TRUE)
       
   730       set(SDL_VIDEO_OPENGL_ES2 1)
       
   731       set(SDL_VIDEO_RENDER_OGL_ES2 1)
       
   732     endif()
       
   733   endif()
       
   734   list(APPEND EXTRA_LDFLAGS "-Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit")
       
   735 endif()
       
   736 
   691 # Platform-specific options and settings
   737 # Platform-specific options and settings
   692 if(EMSCRIPTEN)
   738 if(EMSCRIPTEN)
   693   # Hide noisy warnings that intend to aid mostly during initial stages of porting a new
   739   # Hide noisy warnings that intend to aid mostly during initial stages of porting a new
   694   # project. Uncomment at will for verbose cross-compiling -I/../ path info.
   740   # project. Uncomment at will for verbose cross-compiling -I/../ path info.
   695   add_definitions(-Wno-warn-absolute-paths)
   741   add_definitions(-Wno-warn-absolute-paths)
  1088 elseif(APPLE)
  1134 elseif(APPLE)
  1089   # TODO: rework this for proper MacOS X, iOS and Darwin support
  1135   # TODO: rework this for proper MacOS X, iOS and Darwin support
  1090 
  1136 
  1091   # Requires the darwin file implementation
  1137   # Requires the darwin file implementation
  1092   if(SDL_FILE)
  1138   if(SDL_FILE)
  1093     file(GLOB EXTRA_SOURCES ${PROJECT_SOURCE_DIR}/src/file/cocoa/*.m)
  1139     file(GLOB EXTRA_SOURCES ${SDL2_SOURCE_DIR}/src/file/cocoa/*.m)
  1094     set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES})
  1140     set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES})
  1095     set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
  1141     set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
  1096     set(HAVE_SDL_FILE TRUE)
  1142     set(HAVE_SDL_FILE TRUE)
  1097     set(SDL_FRAMEWORK_COCOA 1)
  1143     set(SDL_FRAMEWORK_COCOA 1)
  1098     set(SDL_FRAMEWORK_COREVIDEO 1)
  1144     set(SDL_FRAMEWORK_COREVIDEO 1)