Skip to content

Commit a028923

Browse files
Peppersawcemadame-rachelle
authored andcommitted
Haiku support patch
1 parent 6481f8c commit a028923

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ else()
309309
# If we're compiling with a custom GCC on the Mac (which we know since g++-4.2 doesn't support C++11) statically link libgcc.
310310
set( ALL_C_FLAGS "-static-libgcc" )
311311
endif()
312-
elseif( NOT MINGW )
312+
elseif( NOT MINGW AND NOT HAIKU )
313313
# Generic GCC/Clang requires position independent executable to be enabled explicitly
314314
set( ALL_C_FLAGS "${ALL_C_FLAGS} -fPIE" )
315315
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie" )

libraries/ZVulkan/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ if(WIN32)
188188
add_definitions(-DUNICODE -D_UNICODE)
189189
else()
190190
set(ZVULKAN_SOURCES ${ZVULKAN_SOURCES} ${ZVULKAN_UNIX_SOURCES})
191-
set(ZVULKAN_LIBS ${CMAKE_DL_LIBS} -ldl)
191+
if(NOT HAIKU)
192+
set(ZVULKAN_LIBS ${CMAKE_DL_LIBS} -ldl)
193+
else()
194+
set(ZVULKAN_LIBS ${CMAKE_DL_LIBS})
195+
endif()
192196
add_definitions(-DUNIX -D_UNIX)
193197
add_link_options(-pthread)
194198
endif()

libraries/ZWidget/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ elseif(APPLE)
130130
add_link_options(-pthread)
131131
else()
132132
set(ZWIDGET_SOURCES ${ZWIDGET_SOURCES} ${ZWIDGET_SDL2_SOURCES})
133-
set(ZWIDGET_LIBS ${CMAKE_DL_LIBS} -ldl)
133+
if(NOT HAIKU)
134+
set(ZWIDGET_LIBS ${CMAKE_DL_LIBS} -ldl)
135+
else()
136+
set(ZWIDGET_LIBS ${CMAKE_DL_LIBS})
137+
endif()
134138
add_definitions(-DUNIX -D_UNIX)
135139
add_link_options(-pthread)
136140
endif()

src/common/engine/i_specialpaths.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "zstring.h"
44

5-
#ifdef __unix__
5+
#if defined(__unix__) || defined(__HAIKU__)
66
FString GetUserFile (const char *path);
77
#endif
88
FString M_GetAppDataPath(bool create);

src/common/rendering/gl_load/gl_load.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static PROC WinGetProcAddress(const char *name)
134134
#if defined(__APPLE__)
135135
#define IntGetProcAddress(name) AppleGLGetProcAddress(name)
136136
#else
137-
#if defined(__sgi) || defined(__sun) || defined(__unix__)
137+
#if defined(__sgi) || defined(__sun) || defined(__unix__) || defined(__HAIKU__)
138138
void* SDL_GL_GetProcAddress(const char* proc);
139139
#define IntGetProcAddress(name) SDL_GL_GetProcAddress((const char*)name)
140140
//#define IntGetProcAddress(name) PosixGetProcAddress((const GLubyte*)name)

src/version.h

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ const char *GetVersionString();
105105

106106
#if defined(__APPLE__) || defined(_WIN32)
107107
#define GAME_DIR GAMENAME
108+
#elif defined(__HAIKU__)
109+
#define GAME_DIR "config/settings/" GAMENAME
108110
#else
109111
#define GAME_DIR ".config/" GAMENAMELOWERCASE
110112
#endif

0 commit comments

Comments
 (0)