Initial for building PSP version with CMake

This commit is contained in:
Wouter Wijsman 2021-11-29 18:42:13 +01:00 committed by Ozkan Sezer
parent d09f80ef18
commit 21fd0047e3
4 changed files with 67 additions and 5 deletions

View File

@ -224,7 +224,7 @@ if(APPLE OR ARCH_64 OR MSVC_CLANG)
set(OPT_DEF_SSEMATH ON) set(OPT_DEF_SSEMATH ON)
endif() endif()
endif() endif()
if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA) if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP)
set(OPT_DEF_LIBC ON) set(OPT_DEF_LIBC ON)
endif() endif()
@ -328,7 +328,7 @@ if(EMSCRIPTEN)
set(SDL_CPUINFO_ENABLED_BY_DEFAULT OFF) set(SDL_CPUINFO_ENABLED_BY_DEFAULT OFF)
endif() endif()
if(VITA) if(VITA OR PSP)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF) set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF) set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF)
endif() endif()
@ -2354,6 +2354,62 @@ elseif(VITA)
# CheckPTHREAD() # CheckPTHREAD()
elseif(PSP)
file(GLOB PSP_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/psp/*.c)
set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${PSP_MAIN_SOURCES})
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_PSP 1)
file(GLOB PSP_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/psp/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${PSP_AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE)
endif()
if(SDL_JOYSTICK)
set(SDL_JOYSTICK_PSP 1)
file(GLOB PSP_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/psp/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${PSP_JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE)
endif()
if(SDL_POWER)
set(SDL_POWER_PSP 1)
file(GLOB PSP_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/psp/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${PSP_POWER_SOURCES})
set(HAVE_SDL_POWER TRUE)
endif()
if(SDL_THREADS)
set(SDL_THREAD_PSP 1)
file(GLOB PSP_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c ${SDL2_SOURCE_DIR}/src/thread/psp/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${PSP_THREAD_SOURCES})
set(HAVE_SDL_THREADS TRUE)
endif()
if(SDL_TIMERS)
set(SDL_TIMER_PSP 1)
file(GLOB PSP_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/psp/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${PSP_TIMER_SOURCES})
set(HAVE_SDL_TIMERS TRUE)
endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_PSP 1)
file(GLOB PSP_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/psp/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${PSP_VIDEO_SOURCES})
set(HAVE_SDL_VIDEO TRUE)
set(SDL_VIDEO_OPENGL 1)
set(HAVE_VIDEO_OPENGL TRUE)
endif()
list(APPEND EXTRA_LIBS
pspctrl
psphprm
pspge
pspgu
pspdisplay
pspvfpu
pspaudio
pspvram
GL
)
endif() endif()
if(SDL_VULKAN AND NOT SDL_LOADSO) if(SDL_VULKAN AND NOT SDL_LOADSO)

View File

@ -315,6 +315,7 @@
#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ #cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@
#cmakedefine SDL_AUDIO_DRIVER_OS2 @SDL_AUDIO_DRIVER_OS2@ #cmakedefine SDL_AUDIO_DRIVER_OS2 @SDL_AUDIO_DRIVER_OS2@
#cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@ #cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@
#cmakedefine SDL_AUDIO_DRIVER_PSP @SDL_AUDIO_DRIVER_PSP@
/* Enable various input drivers */ /* Enable various input drivers */
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ #cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
@ -337,6 +338,7 @@
#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ #cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
#cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@ #cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@
#cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@ #cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@
#cmakedefine SDL_JOYSTICK_PSP @SDL_JOYSTICK_PSP@
#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ #cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ #cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
@ -367,6 +369,7 @@
#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ #cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@
#cmakedefine SDL_THREAD_OS2 @SDL_THREAD_OS2@ #cmakedefine SDL_THREAD_OS2 @SDL_THREAD_OS2@
#cmakedefine SDL_THREAD_VITA @SDL_THREAD_VITA@ #cmakedefine SDL_THREAD_VITA @SDL_THREAD_VITA@
#cmakedefine SDL_THREAD_PSP @SDL_THREAD_PSP@
/* Enable various timer systems */ /* Enable various timer systems */
#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@ #cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@
@ -375,6 +378,7 @@
#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ #cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@
#cmakedefine SDL_TIMER_OS2 @SDL_TIMER_OS2@ #cmakedefine SDL_TIMER_OS2 @SDL_TIMER_OS2@
#cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@ #cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@
#cmakedefine SDL_TIMER_PSP @SDL_TIMER_PSP@
/* Enable various video drivers */ /* Enable various video drivers */
#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@ #cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@
@ -395,6 +399,7 @@
#cmakedefine SDL_VIDEO_DRIVER_OS2 @SDL_VIDEO_DRIVER_OS2@ #cmakedefine SDL_VIDEO_DRIVER_OS2 @SDL_VIDEO_DRIVER_OS2@
#cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@ #cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@
#cmakedefine SDL_VIDEO_DRIVER_RISCOS @SDL_VIDEO_DRIVER_RISCOS@ #cmakedefine SDL_VIDEO_DRIVER_RISCOS @SDL_VIDEO_DRIVER_RISCOS@
#cmakedefine SDL_VIDEO_DRIVER_PSP @SDL_VIDEO_DRIVER_PSP@
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@ #cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@ #cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@
@ -469,6 +474,7 @@
#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@ #cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ #cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
#cmakedefine SDL_POWER_VITA @SDL_POWER_VITA@ #cmakedefine SDL_POWER_VITA @SDL_POWER_VITA@
#cmakedefine SDL_POWER_PSP @SDL_POWER_PSP@
/* Enable system filesystem support */ /* Enable system filesystem support */
#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@ #cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@

View File

@ -132,7 +132,7 @@
#define SDL_THREAD_PSP 1 #define SDL_THREAD_PSP 1
/* Enable the PSP timer support (src/timer/psp/\*.c) */ /* Enable the PSP timer support (src/timer/psp/\*.c) */
#define SDL_TIMERS_PSP 1 #define SDL_TIMER_PSP 1
/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */ /* Enable the PSP joystick driver (src/joystick/psp/\*.c) */
#define SDL_JOYSTICK_PSP 1 #define SDL_JOYSTICK_PSP 1

View File

@ -20,7 +20,7 @@
*/ */
#include "../../SDL_internal.h" #include "../../SDL_internal.h"
#ifdef SDL_TIMERS_PSP #ifdef SDL_TIMER_PSP
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_timer.h" #include "SDL_timer.h"
@ -84,7 +84,7 @@ void SDL_Delay(Uint32 ms)
sceKernelDelayThreadCB(ms * 1000); sceKernelDelayThreadCB(ms * 1000);
} }
#endif /* SDL_TIMERS_PSP */ #endif /* SDL_TIMER_PSP */
/* vim: ts=4 sw=4 /* vim: ts=4 sw=4
*/ */