Cross compile Cargo project to Windows msvc target with ease
Project description
cargo-xwinbuild
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
- Install LLVM, on macOS:
brew install llvm
- Install Rust Windows msvc target via rustup, for example,
rustup target add x86_64-pc-windows-msvc
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for cargo_xwinbuild-0.3.2-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45b0ab3895750c882a7838d472455eba4ea92da36306ca656accea1d46f87231 |
|
MD5 | cf60f74a58f717620180154993e0cc89 |
|
BLAKE2b-256 | d9c5ba401d82494b531e9ff0a35bd9397a2a97183048b4b3e8412a21c8af16be |
Hashes for cargo_xwinbuild-0.3.2-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92e6a26301d2395527689f3212e025f74262784d7e1fbc0924f970a1746b3fa0 |
|
MD5 | 3acc40d538593dbfdaafe89a7a047b6f |
|
BLAKE2b-256 | 05b1d5b6a8d2c2b58ac6835e0f655925f7a8ddaa505d5ca73c2c5d93be17c540 |
Hashes for cargo_xwinbuild-0.3.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20fd3d52bf78efb08ff92098f20274867b331748f04483a9d2df5ee086104c41 |
|
MD5 | 690dd3a3d1723154e1868fe6b1326118 |
|
BLAKE2b-256 | c5d43089a80fc2ea3ae9494874aad1f7ce15c4ad185092a24553a245dc13ae59 |
Hashes for cargo_xwinbuild-0.3.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8aa52102523b8479611a53c9472523543c8b9dd7617fa096045c472a8838b56 |
|
MD5 | 9a8109e93113e4505da97d11fb5eb577 |
|
BLAKE2b-256 | ead8676f9016ccf448906db6f25065dfb9df1bbd4328dbd5b1c12b6af8ee0952 |
Hashes for cargo_xwinbuild-0.3.2-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5164cf9e64a7fe2e325aac222b732e28a6389cd378089fce24fef5cf23ed9456 |
|
MD5 | 9c4b5b881c524bcfe2ab2211f41e105f |
|
BLAKE2b-256 | 35fa21d1f042a71f9a66864595d59f9c0237a8077d67d978edcc1ee7a49ea42b |
Hashes for cargo_xwinbuild-0.3.2-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8908b732937aeef6b5ee84fcf22c6729ec6e388a08acf43ab221eeaeef0c5f6 |
|
MD5 | c763c58fe937f67a14131fcd76ab9e5c |
|
BLAKE2b-256 | 29525a10e8c5243bef047d005dfa837fd8b03d062208acd89bc674b39e25c132 |
Hashes for cargo_xwinbuild-0.3.2-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a83ca5727e504d0bedbc974663f3aef011166cab7be7bf96b26369b181137137 |
|
MD5 | dd149e5e8635aebf8546ec08bce0a07a |
|
BLAKE2b-256 | 20b4f4c9af7f5fa4d5343d1e02d3f0c50d8b391f7d37cdc9f67da6e915d7dd40 |