cmake: Haiku fixes. These came from HaikuPorts, specifically this patchset: https://github.com/haikuports/haikuports/blob/462947dd4f285a885d8011cade7cd0f7151cfe74/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.
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c08e51d..4e65d2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)