From fa4dee0e62dcf2bbfb68b17cf97e438eab58be93 Mon Sep 17 00:00:00 2001 From: NeroBurner Date: Tue, 29 Jun 2021 09:57:19 +0200 Subject: Use user provided lib/irrlichtmt if available (#11276) Use user provided lib/irrlichtmt if available Make it possible for a user to provide the IrrlichtMt dependency as subdirectory at `lib/irrlichtmt`. The subdirectory is added with the `EXCLUDE_FROM_ALL` flag to prevent `libirrlichtmt.a` or other header files to be installed. This enables the user to do the following to satisfy the IrrlichtMt dependency: git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt cmake . -DRUN_IN_PLACE=TRUE --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 013687685..0cd134f27 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,10 @@ Download minetest_game (otherwise only the "Development Test" game is available) git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game +Download IrrlichtMt to `lib/irrlichtmt`, it will be used to satisfy the IrrlichtMt dependency that way: + + git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt + Download source, without using Git: wget https://github.com/minetest/minetest/archive/master.tar.gz @@ -191,6 +195,14 @@ Download minetest_game, without using Git: mv minetest_game-master minetest_game cd .. +Download IrrlichtMt, without using Git: + + cd lib/ + wget https://github.com/minetest/irrlicht/archive/master.tar.gz + tar xf master.tar.gz + mv irrlicht-master irrlichtmt + cd .. + #### Build Build a version that runs directly from the source directory: -- cgit v1.2.3 From cf136914cf421ee52f6806eda2fa97740d0ee552 Mon Sep 17 00:00:00 2001 From: JosiahWI <41302989+JosiahWI@users.noreply.github.com> Date: Tue, 27 Jul 2021 12:11:27 -0500 Subject: Take advantage of IrrlichtMt CMake target (#11287) With the CMake changes to IrrlichtMt, it's now possible to use a target for IrrlichtMt. Besides greatly improving the ease of setting up IrrlichtMt for users building the client, it removes the need for Minetest's CMake to include transitive dependencies such as image libraries, cleaning it up a tiny bit. The PR works by finding the IrrlichtMt package and linking to the target it provides. If the package isn't found and it isn't building the client, it will still fall back to using just the headers of old Irrlicht or IrrlichtMt. --- .gitlab-ci.yml | 10 ++-- CMakeLists.txt | 41 +++++++---------- README.md | 3 ++ cmake/Modules/FindIrrlicht.cmake | 61 ------------------------- cmake/Modules/MinetestFindIrrlichtHeaders.cmake | 26 +++++++++++ src/CMakeLists.txt | 41 +++-------------- util/buildbot/buildwin32.sh | 8 ++-- util/buildbot/buildwin64.sh | 8 ++-- util/ci/common.sh | 4 +- 9 files changed, 62 insertions(+), 140 deletions(-) delete mode 100644 cmake/Modules/FindIrrlicht.cmake create mode 100644 cmake/Modules/MinetestFindIrrlichtHeaders.cmake (limited to 'README.md') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b5c4695bb..d335285d5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ stages: - deploy variables: - IRRLICHT_TAG: "1.9.0mt1" + IRRLICHT_TAG: "1.9.0mt2" MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git" CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH @@ -19,14 +19,10 @@ variables: - apt-get update - apt-get -y install build-essential git cmake libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libleveldb-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev script: - - git clone https://github.com/minetest/irrlicht -b $IRRLICHT_TAG - - cd irrlicht - - cmake . -DBUILD_SHARED_LIBS=OFF - - make -j2 - - cd .. + - git clone https://github.com/minetest/irrlicht -b $IRRLICHT_TAG lib/irrlichtmt - mkdir cmakebuild - cd cmakebuild - - cmake -DIRRLICHT_LIBRARY=$PWD/../irrlicht/lib/Linux/libIrrlichtMt.a -DIRRLICHT_INCLUDE_DIR=$PWD/../irrlicht/include -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE .. + - cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE .. - make -j2 - make install artifacts: diff --git a/CMakeLists.txt b/CMakeLists.txt index 42b343540..fe508ffdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,34 +68,25 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt") if(NOT TARGET IrrlichtMt) message(FATAL_ERROR "IrrlichtMt project is missing a CMake target?!") endif() - - # set include dir the way it would normally be - set(IRRLICHT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/irrlichtmt/include") - set(IRRLICHT_LIBRARY IrrlichtMt) else() - find_package(Irrlicht) - if(BUILD_CLIENT AND NOT IRRLICHT_FOUND) - message(FATAL_ERROR "IrrlichtMt is required to build the client, but it was not found.") - elseif(NOT IRRLICHT_INCLUDE_DIR) - message(FATAL_ERROR "Irrlicht or IrrlichtMt headers are required to build the server, but none found.") - endif() -endif() + find_package(IrrlichtMt QUIET) + if(NOT TARGET IrrlichtMt::IrrlichtMt) + string(CONCAT explanation_msg + "The Minetest team has forked Irrlicht to make their own customizations. " + "It can be found here: https://github.com/minetest/irrlicht") + if(BUILD_CLIENT) + message(FATAL_ERROR "IrrlichtMt is required to build the client, but it was not found.\n${explanation_msg}") + endif() -include(CheckSymbolExists) -set(CMAKE_REQUIRED_INCLUDES ${IRRLICHT_INCLUDE_DIR}) -unset(HAS_FORKED_IRRLICHT CACHE) -check_symbol_exists(IRRLICHT_VERSION_MT "IrrCompileConfig.h" HAS_FORKED_IRRLICHT) -if(NOT HAS_FORKED_IRRLICHT) - string(CONCAT EXPLANATION_MSG - "Irrlicht found, but it is not IrrlichtMt (Minetest's Irrlicht fork). " - "The Minetest team has forked Irrlicht to make their own customizations. " - "It can be found here: https://github.com/minetest/irrlicht") - if(BUILD_CLIENT) - message(FATAL_ERROR "${EXPLANATION_MSG}\n" - "Building the client with upstream Irrlicht is no longer possible.") + include(MinetestFindIrrlichtHeaders) + if(NOT IRRLICHT_INCLUDE_DIR) + message(FATAL_ERROR "Irrlicht or IrrlichtMt headers are required to build the server, but none found.\n${explanation_msg}") + endif() + message(STATUS "Found Irrlicht headers: ${IRRLICHT_INCLUDE_DIR}") + add_library(IrrlichtMt::IrrlichtMt INTERFACE IMPORTED) + target_include_directories(IrrlichtMt::IrrlichtMt INTERFACE "${IRRLICHT_INCLUDE_DIR}") else() - message(WARNING "${EXPLANATION_MSG}\n" - "The server can still be built with upstream Irrlicht but this is DISCOURAGED.") + message(STATUS "Found IrrlichtMt ${IrrlichtMt_VERSION}") endif() endif() diff --git a/README.md b/README.md index 0cd134f27..1774d1ea3 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,9 @@ Run it: - Debug build is slower, but gives much more useful output in a debugger. - If you build a bare server you don't need to have the Irrlicht or IrrlichtMt library installed. - In that case use `-DIRRLICHT_INCLUDE_DIR=/some/where/irrlicht/include`. +- IrrlichtMt can also be installed somewhere that is not a standard install path. + - In that case use `-DCMAKE_PREFIX_PATH=/path/to/install_prefix` + - The path must be set so that `$(CMAKE_PREFIX_PATH)/lib/cmake/IrrlichtMt` exists. ### CMake options diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake deleted file mode 100644 index 1e334652b..000000000 --- a/cmake/Modules/FindIrrlicht.cmake +++ /dev/null @@ -1,61 +0,0 @@ - -mark_as_advanced(IRRLICHT_DLL) - -# Find include directory and libraries - -# find our fork first, then upstream (TODO: remove this?) -foreach(libname IN ITEMS IrrlichtMt Irrlicht) - string(TOLOWER "${libname}" libname2) - - find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h - DOC "Path to the directory with IrrlichtMt includes" - PATHS - /usr/local/include/${libname2} - /usr/include/${libname2} - /system/develop/headers/${libname2} #Haiku - PATH_SUFFIXES "include/${libname2}" - ) - - find_library(IRRLICHT_LIBRARY NAMES lib${libname} ${libname} - DOC "Path to the IrrlichtMt library file" - PATHS - /usr/local/lib - /usr/lib - /system/develop/lib # Haiku - ) - - if(IRRLICHT_INCLUDE_DIR OR IRRLICHT_LIBRARY) - break() - endif() -endforeach() - -# Handholding for users -if(IRRLICHT_INCLUDE_DIR AND (NOT IS_DIRECTORY "${IRRLICHT_INCLUDE_DIR}" OR - NOT EXISTS "${IRRLICHT_INCLUDE_DIR}/irrlicht.h")) - message(WARNING "IRRLICHT_INCLUDE_DIR was set to ${IRRLICHT_INCLUDE_DIR} " - "but irrlicht.h does not exist inside. The path will not be used.") - unset(IRRLICHT_INCLUDE_DIR CACHE) -endif() -if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR APPLE) - # (only on systems where we're sure how a valid library looks like) - if(IRRLICHT_LIBRARY AND (NOT EXISTS "${IRRLICHT_LIBRARY}" OR - NOT IRRLICHT_LIBRARY MATCHES "\\.(a|so|dylib|lib)([.0-9]+)?$")) - message(WARNING "IRRLICHT_LIBRARY was set to ${IRRLICHT_LIBRARY} " - "but is not a valid library file. The path will not be used.") - unset(IRRLICHT_LIBRARY CACHE) - endif() -endif() - -# On Windows, find the DLL for installation -if(WIN32) - # If VCPKG_APPLOCAL_DEPS is ON, dll's are automatically handled by VCPKG - if(NOT VCPKG_APPLOCAL_DEPS) - find_file(IRRLICHT_DLL NAMES IrrlichtMt.dll - DOC "Path of the IrrlichtMt dll (for installation)" - ) - endif() -endif(WIN32) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Irrlicht DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR) - diff --git a/cmake/Modules/MinetestFindIrrlichtHeaders.cmake b/cmake/Modules/MinetestFindIrrlichtHeaders.cmake new file mode 100644 index 000000000..d33b296d0 --- /dev/null +++ b/cmake/Modules/MinetestFindIrrlichtHeaders.cmake @@ -0,0 +1,26 @@ +# Locate Irrlicht or IrrlichtMt headers on system. + +foreach(libname IN ITEMS IrrlichtMt Irrlicht) + string(TOLOWER "${libname}" libname2) + + find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h + DOC "Path to the directory with IrrlichtMt includes" + PATHS + /usr/local/include/${libname2} + /usr/include/${libname2} + /system/develop/headers/${libname2} #Haiku + PATH_SUFFIXES "include/${libname2}" + ) + + if(IRRLICHT_INCLUDE_DIR) + break() + endif() +endforeach() + +# Handholding for users +if(IRRLICHT_INCLUDE_DIR AND (NOT IS_DIRECTORY "${IRRLICHT_INCLUDE_DIR}" OR + NOT EXISTS "${IRRLICHT_INCLUDE_DIR}/irrlicht.h")) + message(WARNING "IRRLICHT_INCLUDE_DIR was set to ${IRRLICHT_INCLUDE_DIR} " + "but irrlicht.h does not exist inside. The path will not be used.") + unset(IRRLICHT_INCLUDE_DIR CACHE) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac460883a..7a5e48b49 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -293,33 +293,7 @@ else() if(NOT HAIKU AND NOT APPLE) find_package(X11 REQUIRED) endif(NOT HAIKU AND NOT APPLE) - - ## - # The following dependencies are transitive dependencies from Irrlicht. - # Minetest itself does not use them, but we link them so that statically - # linking Irrlicht works. - if(NOT HAIKU AND NOT APPLE) - # 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}) - endif(NOT HAIKU AND NOT APPLE) - - find_package(JPEG REQUIRED) - find_package(PNG REQUIRED) - if(APPLE) - find_library(CARBON_LIB Carbon REQUIRED) - find_library(COCOA_LIB Cocoa REQUIRED) - find_library(IOKIT_LIB IOKit REQUIRED) - mark_as_advanced( - CARBON_LIB - COCOA_LIB - IOKIT_LIB - ) - SET(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${CARBON_LIB} ${COCOA_LIB} ${IOKIT_LIB}) - endif(APPLE) - ## - endif(BUILD_CLIENT) + endif() find_package(ZLIB REQUIRED) set(PLATFORM_LIBS -lpthread ${CMAKE_DL_LIBS}) @@ -511,9 +485,7 @@ endif() include_directories( ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR} - ${IRRLICHT_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} - ${PNG_INCLUDE_DIR} ${SOUND_INCLUDE_DIRS} ${SQLITE3_INCLUDE_DIR} ${LUA_INCLUDE_DIR} @@ -548,10 +520,7 @@ if(BUILD_CLIENT) target_link_libraries( ${PROJECT_NAME} ${ZLIB_LIBRARIES} - ${IRRLICHT_LIBRARY} - ${JPEG_LIBRARIES} - ${BZIP2_LIBRARIES} - ${PNG_LIBRARIES} + IrrlichtMt::IrrlichtMt ${X11_LIBRARIES} ${SOUND_LIBRARIES} ${SQLITE3_LIBRARY} @@ -559,7 +528,6 @@ if(BUILD_CLIENT) ${GMP_LIBRARY} ${JSON_LIBRARY} ${PLATFORM_LIBS} - ${CLIENT_PLATFORM_LIBS} ) if(NOT USE_LUAJIT) set_target_properties(${PROJECT_NAME} PROPERTIES @@ -629,6 +597,11 @@ endif(BUILD_CLIENT) if(BUILD_SERVER) add_executable(${PROJECT_NAME}server ${server_SRCS} ${extra_windows_SRCS}) add_dependencies(${PROJECT_NAME}server GenerateVersion) + + get_target_property( + IRRLICHT_INCLUDES IrrlichtMt::IrrlichtMt INTERFACE_INCLUDE_DIRECTORIES) + # Doesn't work without PRIVATE/PUBLIC/INTERFACE mode specified. + target_include_directories(${PROJECT_NAME}server PRIVATE ${IRRLICHT_INCLUDES}) target_link_libraries( ${PROJECT_NAME}server ${ZLIB_LIBRARIES} diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index 468df05a9..40c205250 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -30,7 +30,7 @@ if [ -z "$toolchain_file" ]; then fi echo "Using $toolchain_file" -irrlicht_version=1.9.0mt1 +irrlicht_version=1.9.0mt2 ogg_version=1.3.4 vorbis_version=1.3.7 curl_version=7.76.1 @@ -97,7 +97,7 @@ cd $builddir mkdir build cd build -irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';') +irr_dlls=$(echo $libdir/irrlicht/lib/*.dll | tr ' ' ';') vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';') gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';') @@ -113,9 +113,7 @@ cmake -S $sourcedir -B . \ -DENABLE_FREETYPE=1 \ -DENABLE_LEVELDB=1 \ \ - -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlichtmt \ - -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlichtMt.dll.a \ - -DIRRLICHT_DLL="$irr_dlls" \ + -DCMAKE_PREFIX_PATH=$libdir/irrlicht \ \ -DZLIB_INCLUDE_DIR=$libdir/zlib/include \ -DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \ diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index 3b5d61c96..6d3deceae 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -30,7 +30,7 @@ if [ -z "$toolchain_file" ]; then fi echo "Using $toolchain_file" -irrlicht_version=1.9.0mt1 +irrlicht_version=1.9.0mt2 ogg_version=1.3.4 vorbis_version=1.3.7 curl_version=7.76.1 @@ -97,7 +97,7 @@ cd $builddir mkdir build cd build -irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';') +irr_dlls=$(echo $libdir/irrlicht/lib/*.dll | tr ' ' ';') vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';') gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';') @@ -113,9 +113,7 @@ cmake -S $sourcedir -B . \ -DENABLE_FREETYPE=1 \ -DENABLE_LEVELDB=1 \ \ - -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht/include/irrlichtmt \ - -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/libIrrlichtMt.dll.a \ - -DIRRLICHT_DLL="$irr_dlls" \ + -DCMAKE_PREFIX_PATH=$libdir/irrlicht \ \ -DZLIB_INCLUDE_DIR=$libdir/zlib/include \ -DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \ diff --git a/util/ci/common.sh b/util/ci/common.sh index 6a28482fd..70a1bedaf 100644 --- a/util/ci/common.sh +++ b/util/ci/common.sh @@ -11,9 +11,7 @@ install_linux_deps() { shift pkgs+=(libirrlicht-dev) else - # TODO: return old URL when IrrlichtMt 1.9.0mt2 is tagged - #wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt1/ubuntu-bionic.tar.gz" - wget "http://minetest.kitsunemimi.pw/irrlichtmt-patched-temporary.tgz" -O ubuntu-bionic.tar.gz + wget "https://github.com/minetest/irrlicht/releases/download/1.9.0mt2/ubuntu-bionic.tar.gz" sudo tar -xaf ubuntu-bionic.tar.gz -C /usr/local fi -- cgit v1.2.3 From 0257e7150f4c6dfe7b10802ada938143253c1773 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 31 Jul 2021 13:23:13 +0200 Subject: Update IrrlichtMt-related stuff in README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 1774d1ea3..0dd04052d 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,8 @@ Run it: - In that case use `-DIRRLICHT_INCLUDE_DIR=/some/where/irrlicht/include`. - IrrlichtMt can also be installed somewhere that is not a standard install path. - In that case use `-DCMAKE_PREFIX_PATH=/path/to/install_prefix` - - The path must be set so that `$(CMAKE_PREFIX_PATH)/lib/cmake/IrrlichtMt` exists. + - The path must be set so that `$(CMAKE_PREFIX_PATH)/lib/cmake/IrrlichtMt` exists + or that `$(CMAKE_PREFIX_PATH)` is the path of an IrrlichtMt build folder. ### CMake options @@ -275,8 +276,7 @@ Library specific options: GETTEXT_LIBRARY - Only when building with gettext on Windows; path to libintl.dll.a GETTEXT_MSGFMT - Only when building with gettext; path to msgfmt/msgfmt.exe IRRLICHT_DLL - Only on Windows; path to IrrlichtMt.dll - IRRLICHT_INCLUDE_DIR - Directory that contains IrrCompileConfig.h - IRRLICHT_LIBRARY - Path to libIrrlichtMt.a/libIrrlichtMt.so/libIrrlichtMt.dll.a/IrrlichtMt.lib + IRRLICHT_INCLUDE_DIR - Directory that contains IrrCompileConfig.h (usable for server build only) LEVELDB_INCLUDE_DIR - Only when building with LevelDB; directory that contains db.h LEVELDB_LIBRARY - Only when building with LevelDB; path to libleveldb.a/libleveldb.so/libleveldb.dll.a LEVELDB_DLL - Only when building with LevelDB on Windows; path to libleveldb.dll @@ -327,7 +327,7 @@ After you successfully built vcpkg you can easily install the required libraries vcpkg install zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp --triplet x64-windows ``` -- **Note that you currently need to build irrlicht on your own** +- **Don't forget about IrrlichtMt.** The easiest way is to clone it to `lib/irrlichtmt` as described in the Linux section. - `curl` is optional, but required to read the serverlist, `curl[winssl]` is required to use the content store. - `openal-soft`, `libvorbis` and `libogg` are optional, but required to use sound. - `freetype` is optional, it allows true-type font rendering. -- cgit v1.2.3 From e912008cb368c7722b2a2ca48c6e53ab52076b8b Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 1 Sep 2021 19:17:17 +0200 Subject: Update README for zstd changes --- README.md | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 0dd04052d..fef3f4317 100644 --- a/README.md +++ b/README.md @@ -136,25 +136,26 @@ Compiling | CMake | 3.5+ | | | IrrlichtMt | - | Custom version of Irrlicht, see https://github.com/minetest/irrlicht | | SQLite3 | 3.0+ | | +| Zstd | 1.0+ | | | LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present | | GMP | 5.0.0+ | Bundled mini-GMP is used if not present | | JsonCPP | 1.0.0+ | Bundled JsonCPP is used if not present | For Debian/Ubuntu users: - 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 + 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 libzstd-dev For Fedora users: - 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 + 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 libzstd-devel For Arch users: - sudo pacman -S base-devel libcurl-gnutls cmake libxxf86vm libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses + sudo pacman -S base-devel libcurl-gnutls cmake libxxf86vm libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses zstd For Alpine users: - 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 + 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 zstd-dev #### Download @@ -306,8 +307,11 @@ Library specific options: ZLIB_DLL - Only on Windows; path to zlib1.dll ZLIB_INCLUDE_DIR - Directory that contains zlib.h ZLIB_LIBRARY - Path to libz.a/libz.so/zlib.lib + ZSTD_DLL - Only on Windows; path to libzstd.dll + ZSTD_INCLUDE_DIR - Directory that contains zstd.h + ZSTD_LIBRARY - Path to libzstd.a/libzstd.so/ztd.lib -### Compiling on Windows +### Compiling on Windows using MSVC ### Requirements @@ -320,11 +324,9 @@ Library specific options: It is highly recommended to use vcpkg as package manager. -#### a) Using vcpkg to install dependencies - After you successfully built vcpkg you can easily install the required libraries: ```powershell -vcpkg install zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp --triplet x64-windows +vcpkg install zlib zstd curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp --triplet x64-windows ``` - **Don't forget about IrrlichtMt.** The easiest way is to clone it to `lib/irrlichtmt` as described in the Linux section. @@ -338,10 +340,6 @@ There are other optional libraries, but they are not tested if they can build an Use `--triplet` to specify the target triplet, e.g. `x64-windows` or `x86-windows`. -#### b) Compile the dependencies on your own - -This is outdated and not recommended. Follow the instructions on https://dev.minetest.net/Build_Win32_Minetest_including_all_required_libraries#VS2012_Build - ### Compile Minetest #### a) Using the vcpkg toolchain and CMake GUI @@ -370,12 +368,6 @@ cmake --build . --config Release ``` Make sure that the right compiler is selected and the path to the vcpkg toolchain is correct. -#### c) Using your own compiled libraries - -**This is outdated and not recommended** - -Follow the instructions on https://dev.minetest.net/Build_Win32_Minetest_including_all_required_libraries#VS2012_Build - ### Windows Installer using WiX Toolset Requirements: -- cgit v1.2.3