Cherry picked commits from old pi branch (which was based on dumb client).

This commit is contained in:
hiker 2016-11-11 17:21:59 +11:00
parent 8ecb0ecaeb
commit 8d9bb9c30f
6 changed files with 36 additions and 12 deletions

View File

@ -15,6 +15,7 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "STKRelease") set(CMAKE_BUILD_TYPE "STKRelease")
endif() endif()
option(SERVER_ONLY "Create a server only (i.e. no graphics or sound)" OFF)
option(USE_FRIBIDI "Support for right-to-left languages" ON) option(USE_FRIBIDI "Support for right-to-left languages" ON)
option(CHECK_ASSETS "Check if assets are installed in ../stk-assets" ON) option(CHECK_ASSETS "Check if assets are installed in ../stk-assets" ON)
option(USE_SYSTEM_ANGELSCRIPT "Use system angelscript instead of built-in angelscript. If you enable this option, make sure to use a compatible version." OFF) option(USE_SYSTEM_ANGELSCRIPT "Use system angelscript instead of built-in angelscript. If you enable this option, make sure to use a compatible version." OFF)
@ -34,7 +35,7 @@ else()
set(WIIUSE_BUILD ON) set(WIIUSE_BUILD ON)
endif() endif()
if(MINGW OR CYGWIN) if(MINGW OR CYGWIN OR SERVER_ONLY)
option(USE_WIIUSE "Support for wiimote input devices" OFF) option(USE_WIIUSE "Support for wiimote input devices" OFF)
else() else()
option(USE_WIIUSE "Support for wiimote input devices" ON) option(USE_WIIUSE "Support for wiimote input devices" ON)
@ -67,6 +68,10 @@ if(USE_GLES2)
add_definitions(-DUSE_GLES2) add_definitions(-DUSE_GLES2)
endif() endif()
if(SERVER_ONLY)
add_definitions(-DSERVER_ONLY)
endif()
# Build the Bullet physics library # Build the Bullet physics library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src") include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
@ -76,7 +81,7 @@ add_subdirectory("${PROJECT_SOURCE_DIR}/lib/enet")
include_directories("${PROJECT_SOURCE_DIR}/lib/enet/include") include_directories("${PROJECT_SOURCE_DIR}/lib/enet/include")
# Build glew library # Build glew library
if(NOT USE_GLES2) if(NOT USE_GLES2 AND NOT SERVER_ONLY)
add_definitions(-DGLEW_NO_GLU) add_definitions(-DGLEW_NO_GLU)
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/glew") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/glew")
include_directories("${PROJECT_SOURCE_DIR}/lib/glew/include") include_directories("${PROJECT_SOURCE_DIR}/lib/glew/include")
@ -205,12 +210,13 @@ if (OPENMP_FOUND)
endif() endif()
# OpenGL # OpenGL
if(NOT USE_GLES2) if(NOT USE_GLES2 AND NOT SERVER_ONLY)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR}) include_directories(${OPENGL_INCLUDE_DIR})
endif() endif()
if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT SERVER_ONLY)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
include_directories(${X11_INCLUDE_DIR}) include_directories(${X11_INCLUDE_DIR})

View File

@ -1,5 +1,6 @@
# CMakeLists.txt - glew # CMakeLists.txt - glew
if (NOT SERVER_ONLY)
include_directories("include") include_directories("include")
if(APPLE) if(APPLE)
@ -18,3 +19,5 @@ add_library(glew STATIC
) )
target_link_libraries(glew ${OPENGL_LIBRARIES}) target_link_libraries(glew ${OPENGL_LIBRARIES})
endif()

View File

@ -8,9 +8,14 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/"
"${ZLIB_INCLUDE_DIR}" "${ZLIB_INCLUDE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}/../zlib/") # For zconf.h on WIN32 "${CMAKE_CURRENT_BINARY_DIR}/../zlib/") # For zconf.h on WIN32
if(NOT USE_GLES2) if (SERVER_ONLY)
find_package(OpenGL REQUIRED) add_definitions(-DNO_IRR_COMPILE_WITH_OPENGL_)
include_directories(${OPENGL_INCLUDE_DIR}) add_definitions(-DNO_IRR_COMPILE_WITH_X11_)
else()
if(NOT USE_GLES2)
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
endif()
endif() endif()
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)

View File

@ -248,6 +248,10 @@ define out. */
#ifdef NO_IRR_LINUX_XCURSOR_ #ifdef NO_IRR_LINUX_XCURSOR_
#undef _IRR_LINUX_XCURSOR_ #undef _IRR_LINUX_XCURSOR_
#endif #endif
#else
#undef _IRR_LINUX_X11_VIDMODE_
#undef _IRR_LINUX_X11_RANDR_
#endif #endif

View File

@ -68,6 +68,7 @@ namespace irr
} }
} // end namespace irr } // end namespace irr
#if defined(_IRR_COMPILE_WITH_X11_)
namespace namespace
{ {
Atom X_ATOM_CLIPBOARD; Atom X_ATOM_CLIPBOARD;
@ -75,6 +76,7 @@ namespace
Atom X_ATOM_UTF8_STRING; Atom X_ATOM_UTF8_STRING;
Atom X_ATOM_TEXT; Atom X_ATOM_TEXT;
}; };
#endif
namespace irr namespace irr
{ {
@ -596,6 +598,8 @@ static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, boo
} }
#endif #endif
#endif
bool CIrrDeviceLinux::createWindow() bool CIrrDeviceLinux::createWindow()
{ {
#ifdef _IRR_COMPILE_WITH_X11_ #ifdef _IRR_COMPILE_WITH_X11_

View File

@ -71,11 +71,13 @@
* Should help prevent distros building against an incompatible library. * Should help prevent distros building against an incompatible library.
*/ */
#if (IRRLICHT_VERSION_MAJOR < 1 || IRRLICHT_VERSION_MINOR < 7 || \ #if ( IRRLICHT_VERSION_MAJOR < 1 || \
_IRR_MATERIAL_MAX_TEXTURES_ < 8 || \ IRRLICHT_VERSION_MINOR < 7 || \
(!defined(_IRR_COMPILE_WITH_OPENGL_) && \ _IRR_MATERIAL_MAX_TEXTURES_ < 8 || \
!defined(_IRR_COMPILE_WITH_OGLES2_)) || \ ( !defined(_IRR_COMPILE_WITH_OPENGL_) && \
!defined(_IRR_COMPILE_WITH_B3D_LOADER_)) !defined(SERVER_ONLY) ) && \
!defined(_IRR_COMPILE_WITH_OGLES2_) ) || \
!defined(_IRR_COMPILE_WITH_B3D_LOADER_))
#error "Building against an incompatible Irrlicht. Distros, \ #error "Building against an incompatible Irrlicht. Distros, \
please use the included version." please use the included version."
#endif #endif