Fixed bug 3268 - CMAKE: ios fixes Martin Gerhardy ios is not properly handled in the cmake file. this patch is a start to do so - it properly builds for me with it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba2755c..38edd70 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1229,7 +1229,11 @@ elseif(APPLE)
if(SDL_JOYSTICK)
set(SDL_JOYSTICK_IOKIT 1)
- file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
+ if (IOS)
+ file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m)
+ else()
+ file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
+ endif()
set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE)
set(SDL_FRAMEWORK_IOKIT 1)
@@ -1238,7 +1242,12 @@ elseif(APPLE)
if(SDL_HAPTIC)
set(SDL_HAPTIC_IOKIT 1)
- file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
+ if (IOS)
+ file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/dummy/*.c)
+ set(SDL_HAPTIC_DUMMY 1)
+ else()
+ file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
+ endif()
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
set(HAVE_SDL_HAPTIC TRUE)
set(SDL_FRAMEWORK_IOKIT 1)
@@ -1250,7 +1259,11 @@ elseif(APPLE)
if(SDL_POWER)
set(SDL_POWER_MACOSX 1)
- file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
+ if (IOS)
+ file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m)
+ else()
+ file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
+ endif()
set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
set(HAVE_SDL_POWER TRUE)
set(SDL_FRAMEWORK_CARBON 1)
@@ -1304,12 +1317,18 @@ elseif(APPLE)
# iOS hack needed - http://code.google.com/p/ios-cmake/ ?
if(SDL_VIDEO)
- CheckCOCOA()
- if(VIDEO_OPENGL)
- set(SDL_VIDEO_OPENGL 1)
- set(SDL_VIDEO_OPENGL_CGL 1)
- set(SDL_VIDEO_RENDER_OGL 1)
- set(HAVE_VIDEO_OPENGL TRUE)
+ if (IOS)
+ set(SDL_VIDEO_DRIVER_HAIKU 1)
+ file(GLOB UIKITVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/uikit/*.m)
+ set(SOURCE_FILES ${SOURCE_FILES} ${UIKITVIDEO_SOURCES})
+ else()
+ CheckCOCOA()
+ if(VIDEO_OPENGL)
+ set(SDL_VIDEO_OPENGL 1)
+ set(SDL_VIDEO_OPENGL_CGL 1)
+ set(SDL_VIDEO_RENDER_OGL 1)
+ set(HAVE_VIDEO_OPENGL TRUE)
+ endif()
endif()
endif()