Initial Haiku support (#6568)
authormiqlas <miqlas@users.noreply.github.com>
Mon, 30 Oct 2017 07:17:43 +0000 (08:17 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Mon, 30 Oct 2017 07:17:43 +0000 (08:17 +0100)
* Iitial Haiku support

cmake/Modules/FindIrrlicht.cmake
src/CMakeLists.txt
src/client/renderingengine.cpp
src/network/CMakeLists.txt
util/travis/clang-format-whitelist.txt

index 8dda157223769983c4d9ed0b38d2fbce2f6698d3..37349b892b9b3f0b2ea94d92418ce83a6891a7b1 100644 (file)
@@ -42,12 +42,14 @@ else()
                PATHS
                /usr/local/include/irrlicht
                /usr/include/irrlicht
+               /system/develop/headers/irrlicht #Haiku
        )
 
        find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht
                PATHS
                /usr/local/lib
                /usr/lib
+               /system/develop/lib # Haiku
        )
 endif()
 
index f836a9f66f61032e0e33eb4f61b2ed36eaddcad4..82f60be868f48f5c6c67988c0d1a2b8f4c4eb5c4 100644 (file)
@@ -252,6 +252,12 @@ if(NOT MSVC)
        set(USE_GPROF FALSE CACHE BOOL "Use -pg flag for g++")
 endif()
 
+# Haiku endian support
+if(HAIKU)
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE")
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_BSD_SOURCE")
+endif()
+
 # Use cmake_config.h
 add_definitions(-DUSE_CMAKE_CONFIG_H)
 
@@ -300,7 +306,9 @@ if(WIN32)
 else()
        # Unix probably
        if(BUILD_CLIENT)
-               find_package(X11 REQUIRED)
+               if(NOT HAIKU)
+                       find_package(X11 REQUIRED)
+               endif(NOT HAIKU)
                find_package(OpenGL REQUIRED)
                find_package(JPEG REQUIRED)
                find_package(BZip2 REQUIRED)
@@ -328,10 +336,12 @@ else()
                endif(HAVE_LIBRT)
        endif(APPLE)
 
+       if(NOT HAIKU)
        # This way Xxf86vm is found on OpenBSD too
-       find_library(XXF86VM_LIBRARY Xxf86vm)
-       mark_as_advanced(XXF86VM_LIBRARY)
-       set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
+               find_library(XXF86VM_LIBRARY Xxf86vm)
+               mark_as_advanced(XXF86VM_LIBRARY)
+               set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
+       endif(NOT HAIKU)
 
        # Prefer local iconv if installed
        find_library(ICONV_LIBRARY iconv)
index b3abd824d079447c293f1a34a96891a9aacdb3d1..a57388596790ce6528c5f82549f3fa66e6bb2e95 100644 (file)
@@ -34,7 +34,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "inputhandler.h"
 #include "gettext.h"
 
-#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && !defined(SERVER)
+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && \
+               !defined(SERVER) && !defined(__HAIKU__)
 #define XORG_USED
 #endif
 #ifdef XORG_USED
index dedca9f2bfed35842391f4e6845386b0c0ea4779..c6995ab228dc82fb6c8e2434b22de45d72487663 100644 (file)
@@ -17,3 +17,7 @@ if (BUILD_CLIENT)
        )
 endif()
 
+# Haiku networking support
+if(HAIKU)
+       set(PLATFORM_LIBS -lnetwork ${PLATFORM_LIBS})
+endif()
index 84bed6fc913123718dbaf3a7deaac90a0305d163..3fb9da1412c0f7a8afd028a43037a081597d7725 100644 (file)
@@ -16,6 +16,7 @@ src/clientiface.cpp
 src/clientiface.h
 src/client/joystick_controller.cpp
 src/client/joystick_controller.h
+src/client/renderingengine.cpp
 src/clientmap.cpp
 src/clientmap.h
 src/clientmedia.cpp