cmake: make compile with mingw-w64 GCC
The first commit in the series of commits that add support for building with MSYS2.
How much slower is this than the MSVC builds? #2946 got canned for performance problems.
Although mingw64 builds are slower than msvc and the resulting binary size is larger, it runs faster than msvc on modern CPUs.
I fixed MSVC and split the commit in multiple smaller commits and added comments.
Will instructions be added to the README?
Will instructions be added to the README?
I will once the PRs are accepted.
@oltolm Is there anymore work to be done for this PR?
No it's ready for merging.
@oltolm can you rebase , their is conflicts that needs to be resolved :)
I have rebased.
While I can't compile this new build with Windows/Visual Studio CMake (due to an issue not related to this PR), I currently don't see more issues (beside this point which I'm unsure how to address) with PR.
I don't know how long it will take for this PR to be more tested/approved and merged upstream. However, I highly suggest that you put some of this PR's commits into dedicated PRs as many of them are quite short, simpler, reviewable on their own and more likely to be merged. Plus, they address issues impacting other build systems than mingw-gcc. For instance:
- cubeb: disable building tools
- ~cmake: set cmake_minimum_required to 3.10.0 (might supersede https://github.com/dolphin-emu/dolphin/pull/13967)~
- cmake: fix deployment using windeployqt
- cmake: fix linking to RetroAchievements
@sepalani Why not take over the complete this PR or even the complete mingw-w64 branch?
@sepalani Why not take over the complete this PR or even the complete
mingw-w64branch?
Mainly, because I can't do that in a timely manner, I'm currently too busy (IRL, most of the time) for that. There are other PRs that I wish I have more time to review/focus on (e.g. I saw 2 BBA related PRs, refactoring PRs, IOS/USB PRs, ..., not including mine) as well. Lastly, since I'm not the targeted users for this PR, I'll less-likely be able to spot issues/regressions affecting your current workflow.
However, I added to my setup some extra tooling to better review and test this kind of PR, such as cygwin and mingw/msys2, on top of my current environment (Visual Studio and some Linux VMs).
My above advice was only if you want the main Dolphin branch to have a better cmake/mingw support. I can also understand if don't want to be that involved with upstreaming these changes and prefer keeping that in your own branch.
Is this compileable? I'd like to try this, but it doesn't look like it will be merged anytime soon.