Cross compile Cargo project to Windows msvc target with ease
Project description
cargo-xwinbuild
Cross compile Cargo project to Windows msvc target with ease. (LLVM installation required.)
By using this software you are consented to accept the license at https://go.microsoft.com/fwlink/?LinkId=2086102
Installation
cargo install cargo-xwinbuild
You can also install it using pip:
pip install cargo-xwinbuild
Usage
- Install LLVM, on macOS:
brew install llvm
- Install Rust Windows msvc target via rustup, for example,
rustup target add x86_64-pc-windows-msvc
- Run
cargo xwinbuild
, for example,cargo xwinbuild --target x86_64-pc-windows-msvc
Customization
The Microsoft CRT and Windows SDK can be customized using the following environment variables or CLI options.
Environment Variable | CLI option | Description |
---|---|---|
XWIN_ARCH |
--xwin-arch |
The architectures to include, defaults to x86_64,aarch64 , possible values: x86, x86_64, aarch, aarch64 |
XWIN_VARIANT |
--xwin-variant |
The variants to include, defaults to desktop , possible values: desktop, onecore, spectre |
XWIN_VERSION |
--xwin-version |
The version to retrieve, defaults to 16, can either be a major version of 15 or 16, or a <major>.<minor> version |
XWIN_CACHE_DIR |
--xwin-cache-dir |
xwin cache directory to put CRT and SDK files |
CMake Support
Some Rust crates use the cmake crate to build C/C++ dependencies, cargo-xwinbuild will generate a CMake toolchain file automatically to make cross compilation work out of the box.
ninja is required to enable CMake support.
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for cargo_xwinbuild-0.3.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e626c8420a86c9f1355fdb8c602a6e54fcf81687a0f72ce3f04a691e4031bb7 |
|
MD5 | 87ff09979a53a9ece3f19e6cda6891d1 |
|
BLAKE2b-256 | 188e9fb7e4f1f24fd2d55020f77864bc71eeacaae1132ee089232f3cf5385724 |
Hashes for cargo_xwinbuild-0.3.0-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2020774639f2ad232439e9bbc8c288ab87ba35d414ad82377cecb4f284cf8a86 |
|
MD5 | 7141a0a503e585799f32e122d60ec679 |
|
BLAKE2b-256 | 0b4a5f1b5daeb9aec56f0b74f617278bc563990c0ef98b2f8e8a36b776297eae |
Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45c763a442a5a036132aa28cb14f4fbce5f84e99684197b74536174060c807b3 |
|
MD5 | bedeb54c697cb5dc5f56036c38e30697 |
|
BLAKE2b-256 | d84e13ae1ad9e8b2e8015851a9d73578e774802b7ec01b1b9d1c71af7a6a0bc6 |
Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c67250da4c56fd288a9206ea697b62918112a167d2168356a43d36868995563b |
|
MD5 | cd9441f43839dcd7f321b84eea6f2060 |
|
BLAKE2b-256 | 2172b225e006e13beade413d10ef664ee74f23614cf60f650f4bc53f33344bce |
Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7c661e6fac8b855c7d2bcf01f579ea44ebc4ff5d3c15f57faca257037626446 |
|
MD5 | 6912faa41f71bb66da654d8740610eea |
|
BLAKE2b-256 | a5e903745f31f427a6be96a42acfe017e2694b82d567365a528b8a9ee625c74a |
Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec14d836437086bc1d03971ca7cbb9da36f053a35d888e268e737a3fda9214f3 |
|
MD5 | 37dd164648b6c4a80105ade021f36cac |
|
BLAKE2b-256 | b9d8a666d420d6c346dbaee978aa7a3c2b038d2c1747dbf77cd993e271acdd3b |
Hashes for cargo_xwinbuild-0.3.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82ba071369437b3de74f78de071c10cfcf4892df444922754277bddef7c688bd |
|
MD5 | 72c8c3c5556b6c0e3b7f238a1558cccf |
|
BLAKE2b-256 | e97abe5186d4a3bbbd032e894c2a88e918fb39025b8d22be124e02e59acf228a |