-
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
Take advantage of IrrlichtMt target #11287
Conversation
I don't know how this happened but I must have done something whacky with my branches, I'll fix it and force push. |
You'll need to update the wget URL with a precompiled binary package of the new IrrlichtMt repository, which provides the new Or you change the wget command to download latest master and build it |
Where do I get that new URL/precompiled binary package? |
You'd get them when I tag IrrlichtMt 1.9.0mt2 and upload the binaries here. So we're not stuck here, here's the same binaries of the current state uploaded in another place:
|
c3497d8
to
b01c8b6
Compare
Is it still WIP or ready for re-review? EDIT: clang 9 fails:
.. which indicated wrong behaviour, or is it in fact intended this way? |
I am not intending to add more functionality, but the Prometheus build uses old Irrlicht and I removed automatic header detection for old Irrlicht, which maybe I need to put back in? I was careful to support building the server with old irrlicht headers, but I required the variable to be set by hand. Edit: To explain the problem simply, all clang 9 CI builds use the same build.sh script so I can't pass in a variable for Irrlicht headers to just the Prometheus build. |
Also MinGW is failing, and although I suspect the problem, it shouldn't be a problem, so this one requires me to check docs and do some research. I know this seems like it's moving really slowly; I'm working on it mostly on weekends so the bugs are being fixed at a very gradual pace. |
Something I hacked together in the Irrlicht CMake to save time added public dependencies unbeknownst to me (docs aren't even clear on the behavior) and its breaking the MinGW build. This will be on hold for a little bit until I work out the best solution and patch it. |
@JosiahWI I created a fix PR for the unintentional public dependencies minetest/irrlicht#39 Also added a branch using The resulting GitHub Actions show all builds green, except the MSVC ones because no https://github.com/NeroBurner/minetest/runs/2862069811?check_suite_focus=true |
I will rebase shortly. Are the IrrlichtMt binaries for CI updated? |
I'm sorry, I did not see you had committed and I thought I had amended a commit or something. I will always check in the future so this won't happen again. |
Can you reapply the commit? |
This works but I just thought of an edge case: If you build a server with IrrlichtMt available to cmake (not just the headers), you will get an executable that links to IrrlichtMt even though the library itself is not needed. |
We could use the following to get the include dir from the if(TARGET IrrlichtMt::IrrlichtMt)
get_target_property(IRRLICHT_INCLUDE_DIR IrrlichtMt::IrrlichtMt INCLUDE_DIRECTORIES)
endif() |
We probably want the INTERFACE_INCLUDE_DIRECTORIES property if we do that. If a core dev would like the change to be done I can add it. |
sure. |
Previous behavior was to link the IrrlichtMt target which would link libraries that the server does not need. To handle dependencies in a more efficient manner, only the include directories are given to the server now.
I'm giving this my +1, but if you don't mind making the irrlichtmt installation better guided within the error messages, it would be nice. |
You have IrrlichtMt installed system-wideHow it was before:
How it is now:
You have IrrlichtMt cloned to
|
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 and Android or iOS libs, 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.
To do
Ready for Review
How to test
cmake -S . -B build -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/.local
cmake --build build -j $(nproc)
cmake --install build
cmake -S . -B build -DRUN_IN_PLACE=TRUE -DCMAKE_PREFIX_PATH=~/.local
cmake --build build -j $(nproc)