-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Allow users to have 2 different build scripts for Windows depending if rust is the msvc or if it is the gnu build. #38285
Comments
*.lib
files for dependencies for a cargo that it is a Dependency for.
Sure they can. Both rustc-cfg and target_build_utils make exactly this problem a non-problem, but you can also just check the |
Ah Well I realized the linking issue is basically because of this: #27438 Although I got a better idea why not have some command line an option in Think with that it could help somewhat with issues like this? |
Solving the dllimport issue shouldn't need any extensions to build scripts. All that is needed is a way to tell rustc which library a given symbol comes from (via a |
This should be filed against https://github.com/rust-lang/cargo/ if there's any outstanding stuff that @retep998 and @nagisa didn't cover. Thanks! |
The issue is that build scripts cannot have the ability to get if the build of rust is msvc or the gnu build for windows so then it fails.
So, with that it would be nice to have build scripts to be able to do it or at least for windows a custom build script for only the msvc build and then a different one for the gnu windows build.
The reason for this is because if you want to import a lib file for a msvc build version because the gnu produces corrupt binaries they would have to have:
__declspec(dllimport)
That is if they are linking to a *lib file made in C or C++ (like the original cpython lib file shipped with the installable python)
The suggestion is to have support for something like this entirely in Cargo.toml:
This is so that way Windows would have a better build system for multi platform crates that relies on C or C++ code that has multiple platform implementations like Python's C API for example.
The text was updated successfully, but these errors were encountered: