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

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 Windows x86

cargo_xwinbuild-0.3.0-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.0-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.0-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.0-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.0-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.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7e626c8420a86c9f1355fdb8c602a6e54fcf81687a0f72ce3f04a691e4031bb7
MD5 87ff09979a53a9ece3f19e6cda6891d1
BLAKE2b-256 188e9fb7e4f1f24fd2d55020f77864bc71eeacaae1132ee089232f3cf5385724

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 2020774639f2ad232439e9bbc8c288ab87ba35d414ad82377cecb4f284cf8a86
MD5 7141a0a503e585799f32e122d60ec679
BLAKE2b-256 0b4a5f1b5daeb9aec56f0b74f617278bc563990c0ef98b2f8e8a36b776297eae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 45c763a442a5a036132aa28cb14f4fbce5f84e99684197b74536174060c807b3
MD5 bedeb54c697cb5dc5f56036c38e30697
BLAKE2b-256 d84e13ae1ad9e8b2e8015851a9d73578e774802b7ec01b1b9d1c71af7a6a0bc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c67250da4c56fd288a9206ea697b62918112a167d2168356a43d36868995563b
MD5 cd9441f43839dcd7f321b84eea6f2060
BLAKE2b-256 2172b225e006e13beade413d10ef664ee74f23614cf60f650f4bc53f33344bce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a7c661e6fac8b855c7d2bcf01f579ea44ebc4ff5d3c15f57faca257037626446
MD5 6912faa41f71bb66da654d8740610eea
BLAKE2b-256 a5e903745f31f427a6be96a42acfe017e2694b82d567365a528b8a9ee625c74a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 ec14d836437086bc1d03971ca7cbb9da36f053a35d888e268e737a3fda9214f3
MD5 37dd164648b6c4a80105ade021f36cac
BLAKE2b-256 b9d8a666d420d6c346dbaee978aa7a3c2b038d2c1747dbf77cd993e271acdd3b

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.0-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.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 82ba071369437b3de74f78de071c10cfcf4892df444922754277bddef7c688bd
MD5 72c8c3c5556b6c0e3b7f238a1558cccf
BLAKE2b-256 e97abe5186d4a3bbbd032e894c2a88e918fb39025b8d22be124e02e59acf228a

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