mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-25 15:32:00 +00:00
first pass at adding cmake support
This commit is contained in:
parent
a7edf9807c
commit
40eb77bfa1
1 changed files with 43 additions and 1 deletions
|
|
@ -356,7 +356,7 @@ if(EMSCRIPTEN)
|
|||
set(SDL_CPUINFO_ENABLED_BY_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
if(VITA OR PSP OR PS2 OR N3DS)
|
||||
if(VITA OR PSP OR PS2 OR N3DS OR PLAYDATE)
|
||||
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
|
||||
set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF)
|
||||
endif()
|
||||
|
|
@ -1402,6 +1402,44 @@ if(ANDROID)
|
|||
set(HAVE_CLOCK_GETTIME 1)
|
||||
endif()
|
||||
|
||||
elseif(PLAYDATE)
|
||||
file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/playdate/*.c)
|
||||
file(GLOB PD_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/playdate/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${PD_CORE_SOURCES})
|
||||
|
||||
if(SDL_JOYSTICK)
|
||||
set(SDL_JOYSTICK_PLAYDATE 1)
|
||||
file(GLOB PD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/playdate/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${PD_JOYSTICK_SOURCES})
|
||||
set(HAVE_SDL_JOYSTICK TRUE)
|
||||
endif()
|
||||
if(SDL_POWER)
|
||||
set(SDL_POWER_PLAYDATE 1)
|
||||
file(GLOB PD_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/playdate/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${PD_POWER_SOURCES})
|
||||
set(HAVE_SDL_POWER TRUE)
|
||||
endif()
|
||||
if(SDL_VIDEO)
|
||||
set(SDL_VIDEO_DRIVER_PLAYDATE 1)
|
||||
file(GLOB PD_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/playdate/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${PD_VIDEO_SOURCES})
|
||||
set(HAVE_SDL_VIDEO TRUE)
|
||||
endif()
|
||||
if(SDL_SENSOR)
|
||||
set(SDL_SENSOR_PLAYDATE 1)
|
||||
set(HAVE_SDL_SENSORS TRUE)
|
||||
file(GLOB PD_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/playdate/*.m)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${PD_SENSOR_SOURCES})
|
||||
endif()
|
||||
if(SDL_TIMERS)
|
||||
set(SDL_TIMER_PLAYDATE 1)
|
||||
file(GLOB PD_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/playdate/*.c)
|
||||
set(SOURCE_FILES ${SOURCE_FILES} ${PD_TIMER_SOURCES})
|
||||
set(HAVE_SDL_TIMERS TRUE)
|
||||
endif()
|
||||
|
||||
CheckPTHREAD()
|
||||
|
||||
elseif(EMSCRIPTEN)
|
||||
# Hide noisy warnings that intend to aid mostly during initial stages of porting a new
|
||||
# project. Uncomment at will for verbose cross-compiling -I/../ path info.
|
||||
|
|
@ -3417,6 +3455,10 @@ if(APPLE)
|
|||
endforeach()
|
||||
endif()
|
||||
|
||||
if(PLAYDATE)
|
||||
target_include_directories(sdl-build-options INTERFACE "${SDK}/C_API")
|
||||
endif()
|
||||
|
||||
if(SDL_SHARED)
|
||||
add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
|
||||
add_dependencies(SDL2 sdl_headers_copy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue