cmake: Haiku fixes.

These came from HaikuPorts, specifically this patchset:

462947dd4f/media-libs/libsdl2/patches/libsdl2-2.0.14.patchset

This is just the Haiku-specific bits; the more general parts about install
dirs will be split into a different commit here.

Reference issue #4092.
This commit is contained in:
Ryan C. Gordon 2021-07-24 11:02:27 -04:00
parent 7d8f34cb71
commit 403afdb558
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 34 additions and 7 deletions

View File

@ -1170,7 +1170,7 @@ elseif(EMSCRIPTEN)
CheckPTHREAD()
elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS)
elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS AND NOT HAIKU)
if(SDL_AUDIO)
if(SYSV5 OR SOLARIS OR HPUX)
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
@ -2025,30 +2025,46 @@ elseif(APPLE)
CheckPTHREAD()
elseif(HAIKU)
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_HAIKU 1)
file(GLOB HAIKU_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${HAIKU_AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE)
endif()
if(SDL_JOYSTICK)
set(SDL_JOYSTICK_HAIKU 1)
file(GLOB HAIKU_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${HAIKU_JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE)
endif()
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
set(HAVE_SDL_MISC TRUE)
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_HAIKU 1)
file(GLOB HAIKUVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/haiku/*.c)
file(GLOB HAIKUVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${HAIKUVIDEO_SOURCES})
set(HAVE_SDL_VIDEO TRUE)
if(VIDEO_OPENGL)
# TODO: Use FIND_PACKAGE(OpenGL) instead
set(SDL_VIDEO_OPENGL 1)
set(SDL_VIDEO_OPENGL_BGL 1)
set(SDL_VIDEO_OPENGL_HAIKU 1)
set(SDL_VIDEO_RENDER_OGL 1)
list(APPEND EXTRA_LIBS GL)
set(HAVE_VIDEO_OPENGL TRUE)
endif()
endif()
set(SDL_FILESYSTEM_HAIKU 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)
if(SDL_FILESYSTEM)
set(SDL_FILESYSTEM_HAIKU 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)
endif()
if(SDL_TIMERS)
set(SDL_TIMER_HAIKU 1)
@ -2057,13 +2073,24 @@ elseif(HAIKU)
set(HAVE_SDL_TIMERS TRUE)
endif()
if(SDL_POWER)
set(SDL_POWER_HAIKU 1)
file(GLOB HAIKU_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/haiku/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${HAIKU_POWER_SOURCES})
set(HAVE_SDL_POWER TRUE)
endif()
if(SDL_LOCALE)
file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${LOCALE_SOURCES})
set(HAVE_SDL_LOCALE TRUE)
endif()
file(GLOB MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/haiku/*.cc)
set(SOURCE_FILES ${SOURCE_FILES} ${MAIN_SOURCES})
CheckPTHREAD()
list(APPEND EXTRA_LIBS root be media game device textencoding)
elseif(RISCOS)
file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/riscos/*.c)