Skip to content

Commit a95e0d1

Browse files
miqlasnerzhul
miqlas
authored andcommittedOct 30, 2017
Initial Haiku support (#6568)
* Iitial Haiku support
1 parent cd1140f commit a95e0d1

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed
 

‎cmake/Modules/FindIrrlicht.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ else()
4242
PATHS
4343
/usr/local/include/irrlicht
4444
/usr/include/irrlicht
45+
/system/develop/headers/irrlicht #Haiku
4546
)
4647

4748
find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht
4849
PATHS
4950
/usr/local/lib
5051
/usr/lib
52+
/system/develop/lib # Haiku
5153
)
5254
endif()
5355

‎src/CMakeLists.txt

+14-4
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ if(NOT MSVC)
252252
set(USE_GPROF FALSE CACHE BOOL "Use -pg flag for g++")
253253
endif()
254254

255+
# Haiku endian support
256+
if(HAIKU)
257+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE")
258+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_BSD_SOURCE")
259+
endif()
260+
255261
# Use cmake_config.h
256262
add_definitions(-DUSE_CMAKE_CONFIG_H)
257263

@@ -300,7 +306,9 @@ if(WIN32)
300306
else()
301307
# Unix probably
302308
if(BUILD_CLIENT)
303-
find_package(X11 REQUIRED)
309+
if(NOT HAIKU)
310+
find_package(X11 REQUIRED)
311+
endif(NOT HAIKU)
304312
find_package(OpenGL REQUIRED)
305313
find_package(JPEG REQUIRED)
306314
find_package(BZip2 REQUIRED)
@@ -328,10 +336,12 @@ else()
328336
endif(HAVE_LIBRT)
329337
endif(APPLE)
330338

339+
if(NOT HAIKU)
331340
# This way Xxf86vm is found on OpenBSD too
332-
find_library(XXF86VM_LIBRARY Xxf86vm)
333-
mark_as_advanced(XXF86VM_LIBRARY)
334-
set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
341+
find_library(XXF86VM_LIBRARY Xxf86vm)
342+
mark_as_advanced(XXF86VM_LIBRARY)
343+
set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
344+
endif(NOT HAIKU)
335345

336346
# Prefer local iconv if installed
337347
find_library(ICONV_LIBRARY iconv)

‎src/client/renderingengine.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3434
#include "inputhandler.h"
3535
#include "gettext.h"
3636

37-
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && !defined(SERVER)
37+
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && \
38+
!defined(SERVER) && !defined(__HAIKU__)
3839
#define XORG_USED
3940
#endif
4041
#ifdef XORG_USED

‎src/network/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ if (BUILD_CLIENT)
1717
)
1818
endif()
1919

20+
# Haiku networking support
21+
if(HAIKU)
22+
set(PLATFORM_LIBS -lnetwork ${PLATFORM_LIBS})
23+
endif()

‎util/travis/clang-format-whitelist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ src/clientiface.cpp
1616
src/clientiface.h
1717
src/client/joystick_controller.cpp
1818
src/client/joystick_controller.h
19+
src/client/renderingengine.cpp
1920
src/clientmap.cpp
2021
src/clientmap.h
2122
src/clientmedia.cpp

0 commit comments

Comments
 (0)