1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge pull request #1782 from korli/haiku

Haiku patch
This commit is contained in:
Ivan Savenko 2023-03-27 18:42:22 +03:00 committed by GitHub
commit 11088100a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 1 deletions

View File

@ -341,6 +341,9 @@ if(NOT WIN32 AND NOT APPLE_IOS)
if(HAVE_RT_LIB)
set(SYSTEM_LIBS ${SYSTEM_LIBS} rt)
endif()
if(HAIKU)
set(SYSTEM_LIBS ${SYSTEM_LIBS} network)
endif()
endif()
if(ENABLE_LUA)

View File

@ -41,6 +41,10 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
# define VCMI_UNIX
# define VCMI_XDG
# define VCMI_FREEBSD
#elif defined(__HAIKU__)
# define VCMI_UNIX
# define VCMI_XDG
# define VCMI_HAIKU
#elif defined(__GNU__) || defined(__gnu_hurd__) || (defined(__MACH__) && !defined(__APPLE__))
# define VCMI_UNIX
# define VCMI_XDG

View File

@ -12,6 +12,8 @@
#ifdef VCMI_WINDOWS
#include <windows.h>
#elif defined(VCMI_HAIKU)
#include <OS.h>
#elif !defined(VCMI_APPLE) && !defined(VCMI_FREEBSD) && !defined(VCMI_HURD)
#include <sys/prctl.h>
#endif
@ -89,6 +91,8 @@ void setThreadName(const std::string &name)
prctl(PR_SET_NAME, name.c_str(), 0, 0, 0);
#elif defined(VCMI_APPLE)
pthread_setname_np(name.c_str());
#elif defined(VCMI_HAIKU)
rename_thread(find_thread(NULL), name.c_str());
#endif
}

View File

@ -33,7 +33,7 @@ else()
set(server_LIBS vcmi)
endif()
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD OR HAIKU)
set(server_LIBS execinfo ${server_LIBS})
endif()
target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip)