-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Support cross-compiling with MinGW #72
Conversation
tools/i686-w64-mingw32.cmake
Outdated
@@ -0,0 +1,14 @@ | |||
set(TOOLCHAIN_PREFIX i686-w64-mingw32) |
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.
We can reduce duplication by making one of the toolchains a symlink to another and then guess TOOLCHAIN_PREFIX
based on CMAKE_CURRENT_LIST_FILE
. That was my first solution, but I recalled that without Developer Mode enabled Windows users could encounter problems with the symlinks.
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.
This and the other "toolchain" file looks, to me, like system- and build-specific config, with no business being shipped; I think move these to .github
(.github/workflows
?), and maybe merge them (looks like they're identical except for TOOLCHAIN_PREFIX
and CMAKE_SYSTEM_PROCESSOR
, which maybe can go into -D
?) or inline them as -D
wholesale.
Wait, is pci_generator being compiled for the target and then run via wine? Does CMake really not support compiling build-step generators for the host instead? |
Yep, it does not. I can try switching to use |
Okay well that kinda fucking sucks, what's the point of CMake. |
It won't work with just binfmt sadly, because Wine does not use MinGW bin directories (or Ubuntu custom paths for runtime) by default and CMake does not propagete environmental variables (e.g., |
Rebase might be done to hastily, I don't know what's your preferred workflow, sorry. I removed wine dependency altogether and switched to use ExternalProject as discussed. The conditions are made to not be MinGW dependent, so naively it should work in other cross-compilation environments, too. The good news is that the jobs are down to sub-30-second times. If we remove MinGW CI jobs, I could remove the toolchains, too. I walked through the changes only once this time, so there might be more clean-up chances I missed. |
Looks fine, CI passes, works for me on native builds; thanks! |
Cheers! |
Fixes: #71
Toolchains and everything around them is primarily there to support CI. If you don't want that, changes in src/system/displays/displays_windows.cpp and CMakeLists.txt:148,171ff are enough to support MinGW.