Cross compile Cargo project to Windows MSVC target with ease
Project description
cargo-xwin
formerly 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-xwin
You can also install it using pip:
pip install cargo-xwin
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 xwin build
, for example,cargo xwin build --target x86_64-pc-windows-msvc
Run tests with wine
With wine installed, you can run tests with the cargo xwin test
command,
for example, cargo xwin test --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-xwin 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_xwin-0.6.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03529e9227c058e1ac37b44d2211a3b6c0527eea11061f5763c5cae001dc88b4 |
|
MD5 | 1dae97a5cae1f8b18ed1b70b1aeaab98 |
|
BLAKE2b-256 | 7c9810326f6d62e776a3d4aa41c1a4c8d7dd5f0b4730d7b791a890b2bbd10648 |
Hashes for cargo_xwin-0.6.0-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f47459fee01409323475ebeb46e06eba1fcd641b1c2a9231181582c1adbec8c |
|
MD5 | 00644af374f54cab9891e47bc08316bd |
|
BLAKE2b-256 | a7899be9e5c85406c5a704650d14b9dd361040c654113c4db53352c45c0a2880 |
Hashes for cargo_xwin-0.6.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8795da42bfceb2e95c712b8087d1fc8203fa30dbec94c7159e46687504cf12d |
|
MD5 | 82f6e49b66f6ce5c19511de9d57454f8 |
|
BLAKE2b-256 | 4c36594370d95b51c9e3384b9ee718fd7fdfcafaa80ed5ed336c781e82201805 |
Hashes for cargo_xwin-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90e06816f34838b10fff15e29966c15ea33892afa100bcd3468473ef7b29ea8b |
|
MD5 | b309fc2c4f55e2108fc18f56a46b51c9 |
|
BLAKE2b-256 | 5b4842fd737d3a0fcd9f856c3330769d5a5874edd6afc2b7f3ee851941a3edf0 |
Hashes for cargo_xwin-0.6.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd6dd1d753c03cc9474a321ec51dfce3035762d26f703029ab0fc55527ebf03 |
|
MD5 | 3331ed8350d5a9346ea3ebc2384f2e64 |
|
BLAKE2b-256 | 364c49d9344e7b6b8c9334b1da1378ce0fe225aa9d765fcc8a8d4751cf887535 |
Hashes for cargo_xwin-0.6.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bbdcb10efa0784a0d33770d1dc174fbead450747d323e80c3e195f7119063a9 |
|
MD5 | 8e999143f6f4947afe50dd855a91afc2 |
|
BLAKE2b-256 | 16748dce3464ddbddb30601f6e0fc505e176cc05eee1a5bc2fb6397d7738c427 |
Hashes for cargo_xwin-0.6.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5db2fc14e49dc2f3fbbebad7ba6b390586cafe73ab6d3e6553362b3a97d8ea96 |
|
MD5 | 8c5f64772f0764a6c3c42177ff58938f |
|
BLAKE2b-256 | b84cb533e8610735e350d1cd37757c7f3a0e2f7b534bad1b3150285cccc79bd4 |