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
Run tests with wine
With wine installed, you can run tests with the cargo xwintest
command,
for example, cargo xwintest --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.4.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd6a82d0defe449adcb5f579cc2cebeb403747d105d7545aaa333c8ea6a34549 |
|
MD5 | a8c72a3e6a81a65524ace474f87c6b47 |
|
BLAKE2b-256 | cb184f8efbe87867c2e42a86d7fffc31ece58fbdb837f5079d02e309d4e1cf7c |
Hashes for cargo_xwinbuild-0.4.0-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f05567ef8de69c27f12df1ec805e28aab6c766bae313c6a597a1f6857ec02a1f |
|
MD5 | ed52fccc25a23e5d4aa2b4246ba17447 |
|
BLAKE2b-256 | 6edc72812367587d7247c58594ce41282990d243caaf632576d7c653a20e6ea2 |
Hashes for cargo_xwinbuild-0.4.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88aa428bf48e2c0fbd10192eac8dda18fe1ca107c4934205d8f3e5d7f6a01ad7 |
|
MD5 | aefac1a6656f4844a24da441ab6818da |
|
BLAKE2b-256 | f197c50075ccaa9aea26f0abd283ab8538334c536d46839ff302b97145f3d964 |
Hashes for cargo_xwinbuild-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3909201554f800df256cabe79aafbae3bfd5a89a09bd4ff5b17aed579a8a4e78 |
|
MD5 | c95abed48bc7a627d895be5658732820 |
|
BLAKE2b-256 | 32e9008f3bf6f66185b4d5f57b06f3e7846e69e03a53c9d8066a5e4560b1e64a |
Hashes for cargo_xwinbuild-0.4.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683f47dbfc933ce3760c0634ae0139189f03f914af91b1958caaf03a3e9135a0 |
|
MD5 | 368cfa478f74a7581380d123e61cc5ce |
|
BLAKE2b-256 | 5e74ec578579f5c24d19aac88f75b398614c2ce372002aced441c9dee1f6af07 |
Hashes for cargo_xwinbuild-0.4.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96a0faedf1325bf1f4fcafcc5b1c20380512ddb86a15af36be61ec7332361a72 |
|
MD5 | aca37a07a8afddc1ee936b266be1e233 |
|
BLAKE2b-256 | eba01638ca3fdbda6f57179d7fe12f929130e0e4d9cffb5a63db4670bcb4ec0c |
Hashes for cargo_xwinbuild-0.4.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b46ca34f1d08ba3ad540ebc4cdfb298b7092262c21da4e4f972ecb26b4a67dbb |
|
MD5 | c7d4f4dc940d0d042a1d7688da99d545 |
|
BLAKE2b-256 | 30b14554416866b9608475972f16da438649129e4339b363bd6478246d553b9d |