Skip to content

Commit 91c9313

Browse files
committedMar 9, 2021
Switch Irrlicht dependency to our own fork
-> https://github.com/minetest/irrlicht
1 parent 3579dd2 commit 91c9313

File tree

4 files changed

+39
-56
lines changed

4 files changed

+39
-56
lines changed
 

Diff for: ‎CMakeLists.txt

+23
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
6161

6262
# This is done here so that relative search paths are more reasonable
6363
find_package(Irrlicht)
64+
if(BUILD_CLIENT AND NOT IRRLICHT_FOUND)
65+
message(FATAL_ERROR "Irrlicht is required to build the client, but it was not found.")
66+
elseif(IRRLICHT_INCLUDE_DIR STREQUAL "")
67+
message(FATAL_ERROR "Irrlicht headers are required to build the server, but none found.")
68+
endif()
69+
70+
include(CheckSymbolExists)
71+
set(CMAKE_REQUIRED_INCLUDES ${IRRLICHT_INCLUDE_DIR})
72+
unset(HAS_FORKED_IRRLICHT CACHE)
73+
check_symbol_exists(IRRLICHT_VERSION_MT "IrrCompileConfig.h" HAS_FORKED_IRRLICHT)
74+
if(NOT HAS_FORKED_IRRLICHT)
75+
string(CONCAT EXPLANATION_MSG
76+
"Irrlicht found, but it is not Minetest's Irrlicht fork. "
77+
"The Minetest team has forked Irrlicht to make their own customizations. "
78+
"It can be found here: https://github.com/minetest/irrlicht")
79+
if(BUILD_CLIENT)
80+
message(FATAL_ERROR "${EXPLANATION_MSG}\n"
81+
"Building the client with upstream Irrlicht is no longer possible.")
82+
else()
83+
message(WARNING "${EXPLANATION_MSG}\n"
84+
"The server can still be built with upstream Irrlicht but this is DISCOURAGED.")
85+
endif()
86+
endif()
6487

6588

6689
# Installation

Diff for: ‎README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -134,27 +134,27 @@ Compiling
134134
|------------|---------|------------|
135135
| GCC | 4.9+ | Can be replaced with Clang 3.4+ |
136136
| CMake | 2.6+ | |
137-
| Irrlicht | 1.7.3+ | |
137+
| Irrlicht | - | Custom version required, see https://github.com/minetest/irrlicht |
138138
| SQLite3 | 3.0+ | |
139139
| LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present |
140140
| GMP | 5.0.0+ | Bundled mini-GMP is used if not present |
141141
| JsonCPP | 1.0.0+ | Bundled JsonCPP is used if not present |
142142

143143
For Debian/Ubuntu users:
144144

145-
sudo apt install g++ make libc6-dev libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
145+
sudo apt install g++ make libc6-dev cmake libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
146146

147147
For Fedora users:
148148

149-
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libvorbis-devel libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel irrlicht-devel bzip2-libs gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel doxygen spatialindex-devel bzip2-devel
149+
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libvorbis-devel libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel
150150

151151
For Arch users:
152152

153-
sudo pacman -S base-devel libcurl-gnutls cmake libxxf86vm irrlicht libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses
153+
sudo pacman -S base-devel libcurl-gnutls cmake libxxf86vm libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses
154154

155155
For Alpine users:
156156

157-
sudo apk add build-base irrlicht-dev cmake bzip2-dev libpng-dev jpeg-dev libxxf86vm-dev mesa-dev sqlite-dev libogg-dev libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev gmp-dev jsoncpp-dev luajit-dev
157+
sudo apk add build-base cmake libpng-dev jpeg-dev libxxf86vm-dev mesa-dev sqlite-dev libogg-dev libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev gmp-dev jsoncpp-dev luajit-dev
158158

159159
#### Download
160160

@@ -209,8 +209,8 @@ Run it:
209209
- You can disable the client build by specifying `-DBUILD_CLIENT=FALSE`.
210210
- You can select between Release and Debug build by `-DCMAKE_BUILD_TYPE=<Debug or Release>`.
211211
- Debug build is slower, but gives much more useful output in a debugger.
212-
- If you build a bare server you don't need to have Irrlicht installed.
213-
- In that case use `-DIRRLICHT_SOURCE_DIR=/the/irrlicht/source`.
212+
- If you build a bare server you don't need to have the Irrlicht library installed.
213+
- In that case use `-DIRRLICHT_INCLUDE_DIR=/some/where/irrlicht/include`.
214214

215215
### CMake options
216216

@@ -246,8 +246,6 @@ General options and their default values:
246246

247247
Library specific options:
248248

249-
BZIP2_INCLUDE_DIR - Linux only; directory where bzlib.h is located
250-
BZIP2_LIBRARY - Linux only; path to libbz2.a/libbz2.so
251249
CURL_DLL - Only if building with cURL on Windows; path to libcurl.dll
252250
CURL_INCLUDE_DIR - Only if building with cURL; directory where curl.h is located
253251
CURL_LIBRARY - Only if building with cURL; path to libcurl.a/libcurl.so/libcurl.lib
@@ -276,7 +274,6 @@ Library specific options:
276274
SPATIAL_LIBRARY - Only when building with LibSpatial; path to libspatialindex_c.so/spatialindex-32.lib
277275
LUA_INCLUDE_DIR - Only if you want to use LuaJIT; directory where luajit.h is located
278276
LUA_LIBRARY - Only if you want to use LuaJIT; path to libluajit.a/libluajit.so
279-
MINGWM10_DLL - Only if compiling with MinGW; path to mingwm10.dll
280277
OGG_DLL - Only if building with sound on Windows; path to libogg.dll
281278
OGG_INCLUDE_DIR - Only if building with sound; directory that contains an ogg directory which contains ogg.h
282279
OGG_LIBRARY - Only if building with sound; path to libogg.a/libogg.so/libogg.dll.a
@@ -314,9 +311,10 @@ It is highly recommended to use vcpkg as package manager.
314311

315312
After you successfully built vcpkg you can easily install the required libraries:
316313
```powershell
317-
vcpkg install irrlicht zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp --triplet x64-windows
314+
vcpkg install zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp --triplet x64-windows
318315
```
319316

317+
- **Note that you currently need to build irrlicht on your own**
320318
- `curl` is optional, but required to read the serverlist, `curl[winssl]` is required to use the content store.
321319
- `openal-soft`, `libvorbis` and `libogg` are optional, but required to use sound.
322320
- `freetype` is optional, it allows true-type font rendering.

Diff for: ‎cmake/Modules/FindIrrlicht.cmake

+7-44
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,35 @@
11

22
mark_as_advanced(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL)
3-
set(IRRLICHT_SOURCE_DIR "" CACHE PATH "Path to irrlicht source directory (optional)")
43

4+
# Find include directory and libraries
55

6-
# Find include directory
7-
8-
if(NOT IRRLICHT_SOURCE_DIR STREQUAL "")
9-
set(IRRLICHT_SOURCE_DIR_INCLUDE
10-
"${IRRLICHT_SOURCE_DIR}/include"
11-
)
12-
13-
set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a Irrlicht Irrlicht.lib)
14-
15-
if(WIN32)
16-
if(MSVC)
17-
set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Win32-visualstudio")
18-
set(IRRLICHT_LIBRARY_NAMES Irrlicht.lib)
19-
else()
20-
set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Win32-gcc")
21-
set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a libIrrlicht.dll.a)
22-
endif()
23-
else()
24-
set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Linux")
25-
set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a)
26-
endif()
27-
28-
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
29-
PATHS
30-
${IRRLICHT_SOURCE_DIR_INCLUDE}
31-
NO_DEFAULT_PATH
32-
)
33-
34-
find_library(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES}
35-
PATHS
36-
${IRRLICHT_SOURCE_DIR_LIBS}
37-
NO_DEFAULT_PATH
38-
)
39-
40-
else()
6+
if(TRUE)
417
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
8+
DOC "Path to the directory with Irrlicht includes"
429
PATHS
4310
/usr/local/include/irrlicht
4411
/usr/include/irrlicht
4512
/system/develop/headers/irrlicht #Haiku
4613
PATH_SUFFIXES "include/irrlicht"
4714
)
4815

49-
find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht
16+
find_library(IRRLICHT_LIBRARY NAMES libIrrlicht Irrlicht
17+
DOC "Path to the Irrlicht library file"
5018
PATHS
5119
/usr/local/lib
5220
/usr/lib
5321
/system/develop/lib # Haiku
5422
)
5523
endif()
5624

25+
# Users will likely need to edit these
26+
mark_as_advanced(CLEAR IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR)
5727

5828
# On Windows, find the DLL for installation
5929
if(WIN32)
6030
# If VCPKG_APPLOCAL_DEPS is ON, dll's are automatically handled by VCPKG
6131
if(NOT VCPKG_APPLOCAL_DEPS)
62-
if(MSVC)
63-
set(IRRLICHT_COMPILER "VisualStudio")
64-
else()
65-
set(IRRLICHT_COMPILER "gcc")
66-
endif()
6732
find_file(IRRLICHT_DLL NAMES Irrlicht.dll
68-
PATHS
69-
"${IRRLICHT_SOURCE_DIR}/bin/Win32-${IRRLICHT_COMPILER}"
7033
DOC "Path of the Irrlicht dll (for installation)"
7134
)
7235
endif()

Diff for: ‎src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ else()
295295
endif(NOT HAIKU AND NOT APPLE)
296296

297297
find_package(JPEG REQUIRED)
298-
find_package(BZip2 REQUIRED)
299298
find_package(PNG REQUIRED)
300299
if(APPLE)
301300
find_library(CARBON_LIB Carbon REQUIRED)

0 commit comments

Comments
 (0)
Please sign in to comment.