CMakeLists.txt
changeset 9982 9145e51b15bb
parent 9981 a443c97eb294
child 9994 d3e4f7b44d4d
     1.1 --- a/CMakeLists.txt	Tue Dec 29 00:36:03 2015 -0500
     1.2 +++ b/CMakeLists.txt	Tue Dec 29 00:57:24 2015 -0500
     1.3 @@ -688,6 +688,52 @@
     1.4    endif()
     1.5  endif()
     1.6  
     1.7 +if(ANDROID)
     1.8 +  file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
     1.9 +  set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_CORE_SOURCES})
    1.10 +  file(GLOB ANDROID_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/android/*.c)
    1.11 +  set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_MAIN_SOURCES})
    1.12 +  if(SDL_AUDIO)
    1.13 +    set(SDL_AUDIO_DRIVER_ANDROID 1)
    1.14 +    file(GLOB ANDROID_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/android/*.c)
    1.15 +    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_AUDIO_SOURCES})
    1.16 +    set(HAVE_SDL_AUDIO TRUE)
    1.17 +  endif()
    1.18 +  if(SDL_FILESYSTEM)
    1.19 +    set(SDL_FILESYSTEM_ANDROID 1)
    1.20 +    file(GLOB ANDROID_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/android/*.c)
    1.21 +    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_FILESYSTEM_SOURCES})
    1.22 +    set(HAVE_SDL_FILESYSTEM TRUE)
    1.23 +  endif()
    1.24 +  if(SDL_JOYSTICK)
    1.25 +    set(SDL_JOYSTICK_ANDROID 1)
    1.26 +    file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c)
    1.27 +    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_JOYSTICK_SOURCES})
    1.28 +    set(HAVE_SDL_JOYSTICK TRUE)
    1.29 +  endif()
    1.30 +  if(SDL_POWER)
    1.31 +    set(SDL_POWER_ANDROID 1)
    1.32 +    file(GLOB ANDROID_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/android/*.c)
    1.33 +    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_POWER_SOURCES})
    1.34 +    set(HAVE_SDL_POWER TRUE)
    1.35 +  endif()
    1.36 +  if(SDL_VIDEO)
    1.37 +    set(SDL_VIDEO_DRIVER_ANDROID 1)
    1.38 +    file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
    1.39 +    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_VIDEO_SOURCES})
    1.40 +    set(HAVE_SDL_VIDEO TRUE)
    1.41 +
    1.42 +    #enable gles
    1.43 +    if(VIDEO_OPENGLES)
    1.44 +      set(SDL_VIDEO_OPENGL_EGL 1)
    1.45 +      set(HAVE_VIDEO_OPENGLES TRUE)
    1.46 +      set(SDL_VIDEO_OPENGL_ES2 1)
    1.47 +      set(SDL_VIDEO_RENDER_OGL_ES2 1)
    1.48 +    endif()
    1.49 +  endif()
    1.50 +  list(APPEND EXTRA_LDFLAGS "-Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit")
    1.51 +endif()
    1.52 +
    1.53  # Platform-specific options and settings
    1.54  if(EMSCRIPTEN)
    1.55    # Hide noisy warnings that intend to aid mostly during initial stages of porting a new
    1.56 @@ -1090,7 +1136,7 @@
    1.57  
    1.58    # Requires the darwin file implementation
    1.59    if(SDL_FILE)
    1.60 -    file(GLOB EXTRA_SOURCES ${PROJECT_SOURCE_DIR}/src/file/cocoa/*.m)
    1.61 +    file(GLOB EXTRA_SOURCES ${SDL2_SOURCE_DIR}/src/file/cocoa/*.m)
    1.62      set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES})
    1.63      set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
    1.64      set(HAVE_SDL_FILE TRUE)