-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce vcpkg for easier development on Windows #7642
Comments
Has anyone actually built it this way, or is this still more in the experimental stage? Could be interesting to compare the different types of builds. |
This can easily be done without modifying minetest, just with a build script |
@rubenwardy precisely, that's one of the things that I find very interesting in this thing. I'd be glad if someone could test it. |
I recently created a irrlicht port to vcpkg. https://github.com/adrido/irrlicht-vcpkg It brings the goal a bit closer to build Minetest using vcpkg, but it is not enough. Minetests CMakeLists.txt is messed up and overcomplicated. (Are 800+ lines of cmake script realy necessary?) Minetest requires to select the curl.dll in order to enable curl. Dlls are handled well with vcpkg and are automatically copied to the bin directory. So its not required to hard depend on a dll file. There are probably even more issues, but I did not further investigate them. I hope some are able to test the vcpkg port. Ill also anounce it to the irrlicht community, and if there are no objections ill create a PR to vcpkg directly. The goal (best case scenario) would be to call the 2 line script: vcpkg install irrlicht zlib sqlite3 luajit --triplet x64-windows
cmake . -DCMAKE_TOOLCHAIN_FILE=D:\vcpkg\scripts\buildsystems\vcpkg.cmake On Windows 10 with Powershell even a one-line script could be possible (like the linux one-line script) |
i don't see any interest on this if upstream projects doesn't does it themsleves |
I see massive interest in this, it'll help gain contributors on Windows. I started doing this, but my laptop then died and I lost the progress (it was in a VM and not backed up) |
What do you mean by "upstream projects"? If you mean Irrlicht, there will probably never be a CMakeLists.txt file. So its perfectly fine to copy that one from the vcpkg port to the Irrlicht source. The great thing with vcpkg is that it creates a unique interface to manage different libraries. All of Minetests dependencies can be installed with a single line, without messing up with different build-scripts (cmake, msbuild, nothing) , output & include paths, linking- or compileoptions, dependencies of the dependencies, etc.
Sad that you loosed your progress, but if you already have some experience I would be thankful about feedback or help. |
Anything at all that makes developing on Windows less of a soul-crushingly migraine-inducing trip through multiple hells that makes the lobbing of computers from upper floor windows seem like a suddenly great and fun idea.... is very welcome as far as I'm concerned. |
If you're referring to Irrlicht, then it is because Irrlicht is largely dead and only has 1 developer |
I've been reading issues regarding Irrlicht and us blaming on it for the past 7 years. Until when are we going to continue doing that? Anyway, back to this issue. @adrido Could you please streamline and cmake? Would you be willing to do that? I totally agree with you, our cmake is just huge, I think a lot of that stuff was indeed required at some stage, though I think now things should be a bit better. |
Update: Im currently working on the CMake buildsystem to support vcpkg https://github.com/adrido/minetest/tree/vcpkg-buildsystem It simplified the cmake system a little bit, but also complicated some parts. But I will take a look into tiding up cmake in another step and separate PR. It would be really great if someone could follow the documentation https://github.com/adrido/minetest/tree/vcpkg-buildsystem#compiling-on-windows and try if it is complete and understandable. |
Thanks for your work and time adrido!
As a Minetest player and server admin I do really appreciate it.
I can't test it myself since I don't use windows myself, but so far things
are looking good.
About the CMake, yep, it could do with lots of cleaning, and that will for
another PR for sure, for now let's just work on vcpkg.
…On Sat, 2 Mar 2019 at 15:49, adrido ***@***.***> wrote:
Update:
vcpkg supports now irrlicht ***@***.***
<microsoft/vcpkg@ecff299>
)
Im currently working on the CMake buildsystem to support vcpkg
https://github.com/adrido/minetest/tree/vcpkg-buildsystem
It simplified the cmake system a little bit, but also complicated some
parts. But I will take a look into tiding up cmake in another step and
separate PR.
It would be really great if someone could follow the documentation
https://github.com/adrido/minetest/tree/vcpkg-buildsystem#compiling-on-windows
and try if it is complete and understandable.
Im uncertain whether I should keep the old outdated documentation or not.
I would be really thankful about feedback.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7642 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF6gqL69dF3bwUxrGqsE4024_i48sQUcks5vSp1vgaJpZM4V70fT>
.
|
Issue type
Minetest version
5+
OS / Hardware
Operating system: Windows
Summary
Hi folks, hows everyone been?
I just learned about Vcpkg. I think this could help us a lot in making the windows binaries.
The following was take from here.
Example: Using Sqlite
Step 1: Install
First, we need to know what name Sqlite goes by in the ports tree. To do that, we'll run the
search
command and inspect the output:Looking at the list, we can see that the port is named "sqlite3". You can also run the
search
command without arguments to see the full list of packages.Installing is then as simple as using the
install
command.We can check that sqlite3 was successfully installed for x86 windows desktop by running the
list
command.To install for other architectures and platforms such as Universal Windows Platform or x64 Desktop, you can suffix the package name with :
<target>
.PS D:\src\vcpkg> .\vcpkg install sqlite3:x86-uwp zlib:x64-windows
See
.\vcpkg help triplet
for all supported targets.Step 2: Use
VS/MSBuild Project (User-wide integration)
The recommended and most productive way to use vcpkg is via user-wide integration, making the system available for all projects you build. The user-wide integration will prompt for administrator access the first time it is used on a given machine, but afterwords is no longer required and the integration is configured on a per-user basis.
Note: You will need to restart Visual Studio or perform a Build to update intellisense with the changes.
You can now simply use File -> New Project in Visual Studio 2015 or Visual Studio 2017 and the library will be automatically available. For Sqlite, you can try out their C/C++ sample.
To remove the integration for your user, you can use
.\vcpkg integrate remove
.CMake (Toolchain File)
The best way to use installed libraries with cmake is via the toolchain file
scripts\buildsystems\vcpkg.cmake
. To use this file, you simply need to add it onto your CMake command line as-DCMAKE_TOOLCHAIN_FILE=D:\src\vcpkg\scripts\buildsystems\vcpkg.cmake
.If you are using CMake through Open Folder with Visual Studio 2017 you can define
CMAKE_TOOLCHAIN_FILE
by adding a "variables" section to each of yourCMakeSettings.json
configurations:Now let's make a simple CMake project with a main file.
Then, we build our project in the normal CMake way:
Note: The correct sqlite3.dll is automatically copied to the output folder when building for x86-windows. You will need to distribute this along with your application.
Handling libraries without native cmake support
Unlike other platforms, we do not automatically add the
include\
directory to your compilation line by default. If you're using a library that does not provide CMake integration, you will need to explicitly search for the files and add them yourself usingfind_path()
andfind_library()
.The text was updated successfully, but these errors were encountered: