Haiku support patch

This commit is contained in:
Peppersawce 2025-04-05 14:18:33 +02:00 committed by Rachael Alexanderson
parent 6481f8cce9
commit a02892389d
6 changed files with 15 additions and 5 deletions

View file

@ -309,7 +309,7 @@ else()
# 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.
set( ALL_C_FLAGS "-static-libgcc" )
endif()
elseif( NOT MINGW )
elseif( NOT MINGW AND NOT HAIKU )
# Generic GCC/Clang requires position independent executable to be enabled explicitly
set( ALL_C_FLAGS "${ALL_C_FLAGS} -fPIE" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie" )

View file

@ -188,7 +188,11 @@ if(WIN32)
add_definitions(-DUNICODE -D_UNICODE)
else()
set(ZVULKAN_SOURCES ${ZVULKAN_SOURCES} ${ZVULKAN_UNIX_SOURCES})
set(ZVULKAN_LIBS ${CMAKE_DL_LIBS} -ldl)
if(NOT HAIKU)
set(ZVULKAN_LIBS ${CMAKE_DL_LIBS} -ldl)
else()
set(ZVULKAN_LIBS ${CMAKE_DL_LIBS})
endif()
add_definitions(-DUNIX -D_UNIX)
add_link_options(-pthread)
endif()

View file

@ -130,7 +130,11 @@ elseif(APPLE)
add_link_options(-pthread)
else()
set(ZWIDGET_SOURCES ${ZWIDGET_SOURCES} ${ZWIDGET_SDL2_SOURCES})
set(ZWIDGET_LIBS ${CMAKE_DL_LIBS} -ldl)
if(NOT HAIKU)
set(ZWIDGET_LIBS ${CMAKE_DL_LIBS} -ldl)
else()
set(ZWIDGET_LIBS ${CMAKE_DL_LIBS})
endif()
add_definitions(-DUNIX -D_UNIX)
add_link_options(-pthread)
endif()

View file

@ -2,7 +2,7 @@
#include "zstring.h"
#ifdef __unix__
#if defined(__unix__) || defined(__HAIKU__)
FString GetUserFile (const char *path);
#endif
FString M_GetAppDataPath(bool create);

View file

@ -134,7 +134,7 @@ static PROC WinGetProcAddress(const char *name)
#if defined(__APPLE__)
#define IntGetProcAddress(name) AppleGLGetProcAddress(name)
#else
#if defined(__sgi) || defined(__sun) || defined(__unix__)
#if defined(__sgi) || defined(__sun) || defined(__unix__) || defined(__HAIKU__)
void* SDL_GL_GetProcAddress(const char* proc);
#define IntGetProcAddress(name) SDL_GL_GetProcAddress((const char*)name)
//#define IntGetProcAddress(name) PosixGetProcAddress((const GLubyte*)name)

View file

@ -105,6 +105,8 @@ const char *GetVersionString();
#if defined(__APPLE__) || defined(_WIN32)
#define GAME_DIR GAMENAME
#elif defined(__HAIKU__)
#define GAME_DIR "config/settings/" GAMENAME
#else
#define GAME_DIR ".config/" GAMENAMELOWERCASE
#endif