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

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 Windows x86

cargo_xwinbuild-0.3.3-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.3-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.3-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.3-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.3-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.3-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c399e59bf8ed736950487f66d4764da29a459fb1c9462ab97cb807075d02ad4a
MD5 fba79c8a9393e08133148b5cd224a2de
BLAKE2b-256 b9216042c21a9e585b7fd785551294b3180dcfed4791b06cf0972d18dad042f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.3-py3-none-win32.whl
Algorithm Hash digest
SHA256 3fd608048aec0c912a5de77ba39e75ed79df4a75b963d0c4fd50a9c1da7bc9d9
MD5 b8c9d3bf0a6c6d223a6d63f7d4a62326
BLAKE2b-256 6c6bb58b828723a774431c739ded24c9ed5f09efdfd87738f8deeeac60a53c75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 f0d502cc4e3dc96f5f7557002681cdc7917d853534292431fcda23507ea62483
MD5 6f61b4f7c74ccffc84a339de811772ff
BLAKE2b-256 b58d2e899562a98e36d4d04523e3934695d4cd5adcb0c54fd7b22e96d7242e59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5ffe0a4ecb38e5a03621c223d81678760e06b5310a86a662871a8130cc193090
MD5 75eb9840a7d25c4f58ddc44fdd4ab77b
BLAKE2b-256 1f1300c7a01af4b47388ccc0f45e3dce2c5c2e27b7f9168674a67f88113d40a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4d2182a6138c0ffebdf7f6f69db357d4e152af7b4c103f13492bdcb3ca7ac631
MD5 49b8a0b4f99c9f19e73aa4c2010587c3
BLAKE2b-256 0e5411b0cb9c14c883c5943634a1487844c5d5d2db0b578cd91c013fed66697f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cargo_xwinbuild-0.3.3-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 a8c533443e28397c5dc15ac74e1ae1d7f456a0cd22ec9c3e49074c2a9bf50ec1
MD5 cd8da1dd127f967a7986144f374b7dd6
BLAKE2b-256 85d3afb73360551acbc58aba5b238b3f7ad2a7d128d865eb263fee707aecc49f

See more details on using hashes here.

File details

Details for the file cargo_xwinbuild-0.3.3-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.3-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 51b267a0cd6d0b2365d55b098de2ac9011420c23f959a245391c1171a6554e20
MD5 68d4a4ca3786e976326cbe15d3db3bc4
BLAKE2b-256 f97146b79ffdea7648c826fb6ac3f5f17df76b636d2bb611fb05fc5728912d32

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