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.
This commit is contained in:
Sam Lantinga 2016-10-01 12:54:48 -07:00
parent 6a9ee8fa4b
commit 671f2a4914

View file

@ -1229,7 +1229,11 @@ elseif(APPLE)
if(SDL_JOYSTICK) if(SDL_JOYSTICK)
set(SDL_JOYSTICK_IOKIT 1) set(SDL_JOYSTICK_IOKIT 1)
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) file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE) set(HAVE_SDL_JOYSTICK TRUE)
set(SDL_FRAMEWORK_IOKIT 1) set(SDL_FRAMEWORK_IOKIT 1)
@ -1238,7 +1242,12 @@ elseif(APPLE)
if(SDL_HAPTIC) if(SDL_HAPTIC)
set(SDL_HAPTIC_IOKIT 1) set(SDL_HAPTIC_IOKIT 1)
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) file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
set(HAVE_SDL_HAPTIC TRUE) set(HAVE_SDL_HAPTIC TRUE)
set(SDL_FRAMEWORK_IOKIT 1) set(SDL_FRAMEWORK_IOKIT 1)
@ -1250,7 +1259,11 @@ elseif(APPLE)
if(SDL_POWER) if(SDL_POWER)
set(SDL_POWER_MACOSX 1) set(SDL_POWER_MACOSX 1)
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) file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
set(HAVE_SDL_POWER TRUE) set(HAVE_SDL_POWER TRUE)
set(SDL_FRAMEWORK_CARBON 1) set(SDL_FRAMEWORK_CARBON 1)
@ -1304,6 +1317,11 @@ elseif(APPLE)
# iOS hack needed - http://code.google.com/p/ios-cmake/ ? # iOS hack needed - http://code.google.com/p/ios-cmake/ ?
if(SDL_VIDEO) if(SDL_VIDEO)
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() CheckCOCOA()
if(VIDEO_OPENGL) if(VIDEO_OPENGL)
set(SDL_VIDEO_OPENGL 1) set(SDL_VIDEO_OPENGL 1)
@ -1312,6 +1330,7 @@ elseif(APPLE)
set(HAVE_VIDEO_OPENGL TRUE) set(HAVE_VIDEO_OPENGL TRUE)
endif() endif()
endif() endif()
endif()
CheckPTHREAD() CheckPTHREAD()
elseif(HAIKU) elseif(HAIKU)