Skip to main content

Cross compile Cargo project to Windows msvc target with ease

Project description

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-xwinbuild

You can also install it using pip:

pip install cargo-xwinbuild

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 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


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_xwinbuild-0.3.1-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3 Windows x86-64

cargo_xwinbuild-0.3.1-py3-none-win32.whl (2.5 MB view details)

Uploaded Python 3 Windows x86

cargo_xwinbuild-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARMv7l

cargo_xwinbuild-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

cargo_xwinbuild-0.3.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.9 MB view details)

Uploaded Python 3 manylinux: glibc 2.5+ x86-64

cargo_xwinbuild-0.3.1-py3-none-manylinux_2_5_i686.manylinux1_i686.whl (2.9 MB view details)

Uploaded Python 3 manylinux: glibc 2.5+ i686

cargo_xwinbuild-0.3.1-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (5.4 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_xwinbuild-0.3.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 105d01e353428daf8e52602f8806a27eaee6bfcdcb9f927c41df7201fbece95b
MD5 df28e1acc88d25a231486d7ae57607f7
BLAKE2b-256 3e100896277aa7ba6044884c55ac4c555be7df90704d8d82e719314bd648a0fc

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.1-py3-none-win32.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 65cfc4fbdafb0b82793e05fda1219e361399adbe90bd9c4c64b4e1fd6ec68fbe
MD5 e5e4c1c7833a86162bf0dc4c2d7e501f
BLAKE2b-256 98e506bda263aaf7b958a58139e9a99922cdbf02941464846fafb59a5c6b4a6b

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 fe6d4e11ada6fca058c9aaccbbc5674bc98838ff40cc7511d6425050334b9138
MD5 66b85374de206585f1d657c742fb3daf
BLAKE2b-256 970d14e4559caa089243537aad7ca45eea0427dd805ced071a8eec0284b43427

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 29d292c34e868805abecb986e5dda20d0cf2052af9f09bb5dfcf1fa00945d2d5
MD5 cd5678d85fef1f63834cfb9594b5456b
BLAKE2b-256 de730a3e96226838d975d07c1a32cef41e62878a6ed89bef2f238ee4bed04fca

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c7cde693524460ab74f31fa5ab467da077679017d10d5a7011e83c38e0017545
MD5 2ff3ba950429204e9c91b20047d42eb5
BLAKE2b-256 0f5eca34fc02ff420a1ac795f12f7c5abf5d320234c9727ff819568d6504cfdb

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.1-py3-none-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 43ffafbfe66071708a33656522e62657da45a928762d81fd2b276425cf00cd1f
MD5 487870166f0c1955312ec9adacbbe070
BLAKE2b-256 7e77515cf08779ebfcd0e7224dc4da1e939ac944dff61c757ad635dc7493cf38

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.1-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4476e2aba78a84c61b2e46415130583e802a241698433a546fb2c07ee4f7f575
MD5 cfc7c627a1726db0d3a1cbb3afd90ec9
BLAKE2b-256 f698edcceee29b1a2ca8ea01957ca8b7933205ec19232bfcec326f6d64064fb3

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