Hi, this is my first contribution to the forum and I'm not sure if this belongs here.
I only develop on Linux, but for certain reasons I have to work on windows now.
So I've decided to compile minetest on windows. Specifically with the vs2019 community edition. And the truth is that it's a nightmare xD.
Here is a little howto on how to compile minetest without too much effort, just in case it can help someone.
Requirements,
1. VisualStudio with the English Language Pack installed.
2. cmake and git installed.
This can be done easily in user space with "scoop" (https://scoop.sh/), "scoop install cmake git"
Once you get this installed, we can get started.
We should have a directory where we'll work. For simplicity "C:\dev"
Open cmd.exe
ps> cd \
ps> mkdir dev
ps> cd dev
ps> git clone https://github.com/Microsoft/vcpkg.git
ps> cd vcpkg
ps> bootstrap-vcpkg.bat -disableMetrics
After that vcpkg will be ready to use. If you want to enable vcpkg user-wide , you can do it with: "vcpkg integrate install"
Now we can use vcpkg to download and compile dependencies and it will also download and compile the project dependencies.
By default vcpkg uses the x86-windows triplet, if you want to use the 64 bits version you have to use the x64-windows triplet.
So, let's install minetest's dependencies:
# at c:\dev\vcpkg directory
ps> vcpkg.exe install curl:x64-windows
ps> vcpkg.exe install freetype:x64-windows
ps> vcpkg.exe install irrlicht:x64-windows
ps> vcpkg.exe install libogg:x64-windows
ps> vcpkg.exe install libvorbis:x64-windows
ps> vcpkg.exe install openal-soft:x64-windows
ps> vcpkg.exe install luajit:x64-windows
ps> vcpkg.exe install sqlite3:x64-windows
ps> vcpkg.exe install gettext:x64-windows
Now we can download the minetest code, from git or zip or whatever you want:
ps> cd c:\dev
ps> git clone https://github.com/minetest/minetest
ps> cd minetest
we have to create a directory for the solution
ps> mkdir build_win
ps> cd build_win
and now we will create the solution for visual studio, to see other generators, run "cmake -G"
By running cmake with the parameter "-DCMAKE_TOOLCHAIN_FILE=YOUR_VCPKG_DIR\scripts\buildsystems\vcpkg.cmake" cmake will find all the libraries we have downloaded and compiled.
ps> cmake -DCMAKE_TOOLCHAIN_FILE=C:\dev\vcpkg\scripts\buildsystems\vcpkg.cmake ..
And voila, here we have our fancy VS solution.
Now we just open the solution and we'll be able to compile, debug and contribute.
Btw, the executable will be generated in bin directory.
Hope this helps someone.
Easy (I think) minetest compilation in windows
- rubenwardy
- Moderator
- Posts: 6431
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: United Kingdom
- Contact:
Re: Easy (I think) minetest compilation in windows
Also see this video: https://www.youtube.com/watch?v=B4QnlJozFoM
Core Developer | Donate | Join the Matrix chat! | My Twitter | Mods | Minetest Modding Book
Hello profile reader
Hello profile reader
Who is online
Users browsing this forum: No registered users and 1 guest