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
File details
Details for the file cargo_xwin-0.5.0-py3-none-win_amd64.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-win_amd64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5d03f01276913dc2f949baaf622396e465834beed1bea3422634f76110fedab |
|
MD5 | 6b60cc9da487cf3cd7ad48048d995bce |
|
BLAKE2b-256 | 7e925fa51522379428844a4b63067f3539450675bc0bfab006dfddddd54ac667 |
File details
Details for the file cargo_xwin-0.5.0-py3-none-win32.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-win32.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ee6db204df5db7d18ff26cc949ec2cb672ac8d9428bd74fc6ee9c1a656cc12b |
|
MD5 | 5d139613840da13ca2f622c0be032fa0 |
|
BLAKE2b-256 | 9d3b51ef65f0fb19dbbb298fab1561eea7ec8276617eba03c8ae9257e547f066 |
File details
Details for the file cargo_xwin-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 4.5 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d5cb0b2060dd80e07d4d7caa50deda60ad9d290c77957476363c8be7e5160fa |
|
MD5 | 66134a8cfb30ab9919331dde16215612 |
|
BLAKE2b-256 | 3d9a33b2b75479d2f65007a2e2c270f82ddcf1dd447abd7eae01fc272cff2038 |
File details
Details for the file cargo_xwin-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 4.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62b2c9aefbefd9189a22d4689dbd83e6d00b149ba1c2b9d6235021d83772804 |
|
MD5 | eb6887548359903bdd0b4ddfe8f5e518 |
|
BLAKE2b-256 | 13424e7d3cfd60d2fca3a213ee9e83df3754b77ed3bf00cdc74b5696b1ccb46c |
File details
Details for the file cargo_xwin-0.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: Python 3, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce84d04906dd26af8c1e673b51bf90e832bc614123c570f32b5315f41d7c6e22 |
|
MD5 | 58f980a07e55de2c92ce25efa4b3776b |
|
BLAKE2b-256 | 16a06e2c1dfd574ff6728213504e2a7ea38ef928e81ea0cb489afe2fdb6a58e5 |
File details
Details for the file cargo_xwin-0.5.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
- Upload date:
- Size: 4.7 MB
- Tags: Python 3, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cee6137d4912980423615ebf5555cfd20e030f49e2347c5a8a9a7d63d1c92f75 |
|
MD5 | 4a7c16f028b4c0ef86e46ca5fa976065 |
|
BLAKE2b-256 | 7ed659d66170b40adfcd9e30713d4aefbe054ce900d8eb32f315e8f63c909cf4 |
File details
Details for the file cargo_xwin-0.5.0-py3-none-macosx_11_0_arm64.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 10.0 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a591f95faad1d0c4b6a6cc63b045c40a27eed7db11e79441c2906a729bb2acb0 |
|
MD5 | 9e8f03ee197c40933483b98f69c24b74 |
|
BLAKE2b-256 | 35f76b23bd8e19561293fffb983bea6b992aa78706bf04adf8bb1c469c321ed6 |
File details
Details for the file cargo_xwin-0.5.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
.
File metadata
- Download URL: cargo_xwin-0.5.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
- Upload date:
- Size: 6.1 MB
- Tags: Python 3, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 616e3fb830781453dfee2ad93080f77aab53e38313fcfa56cd263d76d60a579c |
|
MD5 | 5d6210566fc30385e4e6ac20bcfc788e |
|
BLAKE2b-256 | 627a103195f397b3bb4f70412fb0d88d411c3f1e05eddb704ce2f6169e2062a1 |