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

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 Windows x86

cargo_xwinbuild-0.3.1_beta.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_beta.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_beta.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_beta.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_beta.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_beta.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1_beta.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1e0e7c95a9130849ed1a7b55fd8441e223f2abac7de8587d1bb56609c40ba738
MD5 4b7bdb59aac86b0200e32b17c695e3b1
BLAKE2b-256 6a49a83b89c8e806c2e31de114996349bc494f82b8883c443a3d11a487ea74ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1_beta.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 463f61c8dbcb8a0252ff622d3d5e41dcedc4cb7a0d6e97b80d440d8c83624f9d
MD5 d78967b19b369374400645bbc62f859e
BLAKE2b-256 326f514b264bb1c3df9746fe1065621d2fc1a0721827f84b3d0e6acad5504768

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1_beta.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 bc0bd07736f29783ce8109a631cfa27959aefc448293c18557ce7ca93098523c
MD5 ea477b5ea9b2c1c238c2a88261293ef3
BLAKE2b-256 46e195dcb6c4a3d7ae4dd070a8b3808046061afb13e75b632f9cfe36e9972028

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1_beta.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 098598f9e5641cc79b96a5c4b6fbddb3d783473d30bb88395e79a1fed98bdc6d
MD5 29ff75f8ff684cdf9a5264c325c97947
BLAKE2b-256 1e94e41021aba8e99935e49fd1c94def73e59d26de306f21a8de3c246084332b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1_beta.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a300002c0f02b3bf4081adb5d23f10453fcb545569a9149c3b68079ea1baeccc
MD5 4ea79395172017fde321af3a1423b9ad
BLAKE2b-256 05fe5e3cf70f91cf64fcf4122c3f3c67279f4a492b5fc59f969ca230c80783b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.1_beta.1-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 729b01328e2c6e4fa62386cfe9f9da71cb0ccc37c49cbd42ef6c25caefa0d829
MD5 af0f3406ae656496f023f935291113b6
BLAKE2b-256 d37cc2311c10805ab2650abebcc351f63f11a73882ff6866323b96edfdbe9442

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.1_beta.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_beta.1-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ed12f8353069366d80d1d57a473c161b00edef76f5ec901bfe35a92c6b2852e6
MD5 3f074ebeaddc3173095cb21031084a5f
BLAKE2b-256 024db02f11668f333db4ee2e84e14963d05d5e92c327f0f630b8691102e02c58

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