Skip to content

Get cross-compilation working again. #6652

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

Merged
merged 2 commits into from
Jun 1, 2025
Merged

Conversation

BMagnu
Copy link
Member

@BMagnu BMagnu commented Mar 29, 2025

Fixes some issues in CMake and in the code (notably the case-sensitive includes) that make cross-compilation from linux to windows using MinGW possible again.

To get this to work, you now need the following CMake settings:

#Enable cross-compilation
-DCMAKE_TOOLCHAIN_FILE=./cmake/cross_compile/mingw64.cmake 
#Shaders and default tables are embedded with a custom executable. Since we're building for windows, we're also building this custom embed tool for windows. So just tell CMake to use a different one we've purpose-built for linux in the past. CMake will notify the user if this is not set properly
-DEMBEDFILE_PATH:FILEPATH=<path to a linux FSO build dir>/bin/embedfile
#It's likely possible to get this to build as well somehow, but it's not that critical for distributing test builds, so just disable them for now. CMake will warn the user if these are set differently, but not prevent trying to build with them should a user want to.
-DFSO_BUILD_WITH_DISCORD:BOOL=OFF
-DFSO_BUILD_FRED2:BOOL=OFF
-DFSO_USE_SPEECH:BOOL=OFF
-DFSO_USE_VOICEREC:BOOL=OFF

@BMagnu BMagnu added the build An issue related to the build systems label Mar 29, 2025
Copy link
Contributor

@Goober5000 Goober5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to configure CMake to set or prompt for those settings?

One of the things that's nice about the current FSO cmake config is that it does a really good job of figuring almost everything out for you. It would be super helpful if these settings were also automatic, or at least prompted.

@JohnAFernandez
Copy link
Contributor

JohnAFernandez commented Apr 3, 2025

We could merge this now and make an issue for someone to work on it later.

@Goober5000
Copy link
Contributor

Lafiel said he's already made progress on some of these, so let's hold off just a little bit.

@JohnAFernandez JohnAFernandez marked this pull request as draft April 10, 2025 16:25
@JohnAFernandez
Copy link
Contributor

Set to draft to help with sorting of open PRs

@BMagnu BMagnu marked this pull request as ready for review June 1, 2025 10:28
@BMagnu
Copy link
Member Author

BMagnu commented Jun 1, 2025

Done the changes, a lot of the required settings are now auto-set and the ones that cannot be are prompted for if they are misconfigured or missing

Copy link
Contributor

@Goober5000 Goober5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terrific work! Looks good.

@BMagnu BMagnu merged commit b3a1b8f into scp-fs2open:master Jun 1, 2025
16 checks passed
@BMagnu BMagnu mentioned this pull request Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build An issue related to the build systems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants