-
Notifications
You must be signed in to change notification settings - Fork 443
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
Add 'windows-mingw-release' CMake preset #3421
Conversation
…ceSet::ResourceSet()' definition is marked dllimport" when building with g++ 12.1.0
…ingw_cmake_presets
… byte into a region of size 0"
CMakeLists.txt
Outdated
# The XCode and MSVC builds each require some more configuration further down. | ||
if(ENABLE_CCACHE AND LINUX) | ||
if(ENABLE_CCACHE AND (LINUX OR MINGW)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc there's a GNU
check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that'd include installations of GCC on osx, which is not something I've tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is not something anyone has ever tested :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, so let's keep MinGW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, what about Makefile or Ninja generator on macOS regardless of the compiler? They should also work by simply specifying the "compiler launcher".
I'd rather just add a check for those generators here (maybe excluding Windows OS, not sure how ccache works there in command-line builds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean by
maybe excluding Windows OS
this PR is for Windows, using the gcc
port mingw-w64 that is used on host-os Windows targeting Windows (not cross-compilation). I know mingw can be used to cross-compile on Linux targeting Windows, but that's unrelated to this PR. I could rewrite it into
if(ENABLE_CCACHE AND (LINUX OR (CMAKE_HOST_WIN32 AND MINGW)))
so I don't wind up unintentionally supporting ccache for platforms using MinGW other than windows (only such case would be cross-compilation from linux to windows afaik).. but I thought that was a nice side-effect so I just skipped checking for CMAKE_HOST_WIN32
.
well, what about Makefile or Ninja generator on macOS regardless of the compiler?
It doesn't matter if you use Makefile or Ninja generator. This PR is enabling ccache forwindows-mingw-release
, both Makefile and Ninja generator.
I just now found out there's no GNU
-variable in CMake (I also thought it did exist), at least not listed here: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
I'm all for supporting other platforms with ccache :), but it's out of scope of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my main remark is that instead of adding every single platform or compiler here we should instead check the CMake generator that's used. I definitely know that ccache works through the standard compiler launcher variables for Makefile and Ninja generators, and definitely neither for Xcode nor for Visual Studio (that's already handled separately).
this PR is for Windows
right, was thinking about msvc :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my main remark is that instead of adding every single platform or compiler here we should instead check the CMake generator that's used.
Ah, now I see what you mean. I'll make a new commit. EDIT: See #3421 (comment)
FYI I also have a |
Running into a crash when starting vcmiserver:
Added to
and I seem to be hitting this for several objects, see attached log. Could this be local setup issues? Or is this a known issue? Didn't find any GitHub issue that resembles this. EDIT: I don't encounter it when building on linux. Could be MinGW related. I have to dig deeper. EDIT: Right, I don't have wog installed on my linux machine. Apparently I had a wog installation in I can also start the game now, although I am greeted by a "TLS Initialziation Error" on starting |
and how does it differ from release build?
I believe your Qt version was built without openssl support |
It passes
Thanks! I'll rebuild with openssl and do some more manual smoke testing to see if there's anything obviously broken with MinGW build. |
such stuff can be passed on the command line, no need to create another preset for it |
Huh, interesting find. I did have a suspicion that we have memory corruption somewhere in CObjectClassesHandler on some systems - due to reported crashes. Might be caused by such outdated wog mod. Noted, will fix. Should not be just a warning in log. |
Here are the solutions to the aforementioned OpenSSL problem: a) Use b) Use Release build
Debug build
c) Build Qt5 from source d) Use conan on Windows to get Qt5 with statically linked OpenSSL I'll go with option EDIT: I did run a I think this is ready to be merged now. |
…sue where OpenSSL dlls had to be manually copied into binary dir for VCMI_launcher to be able to download mods.
right, I always forget about those IDEs that work with CMake directly :) But isn't it possible to define custom variables right inside the IDE? For example, Qt Creator has such feature iirc
I agree
thanks a lot for the investigation! Static libs are fine. P.S. OpenSSL is needed only for the launcher to make https network calls |
In VSCode I think that's possible to do via |
sure, makes complete sense |
…CHER' as 'ccache'.
491dfd8 removes the platform checks. I don't even check if generator is ninja or make, since CMake won't do anything if other generators are used (see https://cmake.org/cmake/help/latest/prop_tgt/LANG_COMPILER_LAUNCHER.html#prop_tgt:%3CLANG%3E_COMPILER_LAUNCHER) - so checking if generator is ninja or make is redundant. Meaning that if user sets the |
Adds a 'windows-mingw-release'-preset (configure, build and test).
Two commits 8846fba and 100664e fixes compilation errors using said preset.
Full disclosure: 100664e is not tested locally. I haven't gotten around to actually running locally built binaries yet. Let me know if you want me to test this locally, or if you were able to test it yourself.