Skip to main content

Cross compile Cargo project to Windows MSVC target with ease

Project description

cargo-xwin

formerly cargo-xwinbuild

CI Crates.io docs.rs PyPI

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

  1. Install LLVM, on macOS: brew install llvm
  2. Install Rust Windows msvc target via rustup, for example, rustup target add x86_64-pc-windows-msvc
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cargo_xwin-0.7.0-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3 Windows x86-64

cargo_xwin-0.7.0-py3-none-win32.whl (2.5 MB view details)

Uploaded Python 3 Windows x86

cargo_xwin-0.7.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (4.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARMv7l

cargo_xwin-0.7.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

cargo_xwin-0.7.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (4.6 MB view details)

Uploaded Python 3 manylinux: glibc 2.5+ x86-64

cargo_xwin-0.7.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl (4.7 MB view details)

Uploaded Python 3 manylinux: glibc 2.5+ i686

cargo_xwin-0.7.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.2 MB view details)

Uploaded Python 3 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

File details

Details for the file cargo_xwin-0.7.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for cargo_xwin-0.7.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d409dc7f20a21b16cd7158eb2efa11fc0ecd4cdf8cd27c089cf11b8007ff6fe0
MD5 e7d61d7646f12055aafc617f2b3b0dcb
BLAKE2b-256 d3b01e830bc58a84dbd9e10ff6a474834ddf1c536a22ba61ef1f1f3c140ea60e

See more details on using hashes here.

File details

Details for the file cargo_xwin-0.7.0-py3-none-win32.whl.

File metadata

  • Download URL: cargo_xwin-0.7.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.10

File hashes

Hashes for cargo_xwin-0.7.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 1b337fba6a790e6f99119362af44ee2b665012c2f6fdf164b83e8ae470df7284
MD5 43236a6828c709f75b53001d50799772
BLAKE2b-256 fdc1e5ea87e14cb5409182cf097d3289577aba8415c6cd357ae7fd86c10c2c4d

See more details on using hashes here.

File details

Details for the file cargo_xwin-0.7.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for cargo_xwin-0.7.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 3019612a7713988ffce9cc9c9a71f69a6b0401279d7206cf83e894d747eaa36a
MD5 77290d9fd147fb86d7699ef52d7b9f33
BLAKE2b-256 64f95da07673e1455b2f7bb2a79a70eae31f8eccd711e93b70e5ddcea1796317

See more details on using hashes here.

File details

Details for the file cargo_xwin-0.7.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cargo_xwin-0.7.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a5fa55ac6497bc59c022acdc37fb4cef1b33262d7f45a1f7127263c5d8622352
MD5 0f8314475c1e88a5c0b477f19e6eccfe
BLAKE2b-256 f0a14a031f719dfb0d11d9e72895a2c869e4a38b3f841ea92ca824272369c4ef

See more details on using hashes here.

File details

Details for the file cargo_xwin-0.7.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cargo_xwin-0.7.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4632447db1da3e67ef4072048f12d6e3b26b4235605d9046359d49b89b036561
MD5 eab51b87073aaa4fe82ebfe1b6959e8a
BLAKE2b-256 02694570f689d3f748ccc1918f5e005a74d39aec357fd1696c7010c53ca937cb

See more details on using hashes here.

File details

Details for the file cargo_xwin-0.7.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for cargo_xwin-0.7.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 7f059a04491e15e01951fde79f47fb3c58c9b56e2f35a8d76ebaacde8a8abbe1
MD5 3ee5b89deb45b0d3d22fb878e68e53ef
BLAKE2b-256 d4d71f38ab488080f75afd1921db6cee2b36955e8a7d4c057f8adc51cfab0b88

See more details on using hashes here.

File details

Details for the file cargo_xwin-0.7.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cargo_xwin-0.7.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 99375a592d673b780ea9a818ec0ab225f4f3bf2194dea1ecb7fc6c03631ac011
MD5 5b6b3caf7317db5da68161f4f6e9074c
BLAKE2b-256 5c373bff61e39f5c234ba4962bb0225352338584605518a6c5e19182149b22b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page