Skip to content
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

build.rs: Fix windows cross compilation #1323

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kkysen
Copy link
Collaborator

@kkysen kkysen commented Jul 17, 2024

@thedataking, I only noticed after you merged #1295 a few things.

This should let us cross-compile from windows, cross-compile to *-windows-gnu (I think; the linker wasn't installed so I couldn't test all the way), and print a clear error when trying to cross-compile to *-windows-msvc. It also lets us do full cross-compilation on rav1d, as the snprintf stuff for windows is only for rav1d-cli.

…t os.

Cross-compiles (even of just `rav1d` the library) failed without this.
…s` so `rav1d` can cross compile to/from windows.
…rror if trying to cross compile to `*-windows-msvc`.
@kkysen kkysen force-pushed the kkysen/fix-windows-cross-compile branch from 41442ad to a61cac8 Compare October 22, 2024 22:54
nasm.flag("-Fdwarf");
#[cfg(all(debug_assertions, windows))]
nasm.flag("-fwin64");
nasm.flag(match os {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should still be guarded by #[cfg(debug_assertions)] because -F implies -g in some nasm versions.

https://www.nasm.us/xdoc/2.14rc5/html/nasmdoc2.html#section-2.1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo build fails on Windows 11
2 participants