cargo-xwin


Namecargo-xwin JSON
Version 0.16.4 PyPI version JSON
download
home_pageNone
SummaryCross compile Cargo project to Windows MSVC target with ease
upload_time2024-02-01 13:19:34
maintainerNone
docs_urlNone
authorNone
requires_python
licenseMIT
keywords windows cargo msvc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cargo-xwin

_formerly cargo-xwinbuild_

[![CI](https://github.com/rust-cross/cargo-xwin/workflows/CI/badge.svg)](https://github.com/rust-cross/cargo-xwin/actions?query=workflow%3ACI)
[![Crates.io](https://img.shields.io/crates/v/cargo-xwin.svg)](https://crates.io/crates/cargo-xwin)
[![docs.rs](https://docs.rs/cargo-xwin/badge.svg)](https://docs.rs/cargo-xwin/)
[![PyPI](https://img.shields.io/pypi/v/cargo-xwin.svg)](https://pypi.org/project/cargo-xwin)
[![Docker Image](https://img.shields.io/docker/pulls/messense/cargo-xwin.svg?maxAge=2592000)](https://hub.docker.com/r/messense/cargo-xwin/)

> 🚀 Help me to become a full-time open-source developer by [sponsoring me on GitHub](https://github.com/sponsors/messense)

Cross compile Cargo project to Windows msvc target with ease.

**By using this software you are consented to accept the license at [https://go.microsoft.com/fwlink/?LinkId=2086102](https://go.microsoft.com/fwlink/?LinkId=2086102)**

## Prerequisite

1. For pure Rust project, no prerequisites needed.
2. For C/C++ dependencies, install [clang](https://clang.llvm.org/) (On macOS run `brew install llvm` and you're good to go).
3. For assembly dependencies, install `llvm-tools-preview` component via `rustup component add llvm-tools-preview` or install [llvm](https://llvm.org).

## Installation

```bash
cargo install cargo-xwin
```

You can also install it using pip:

```bash
pip install cargo-xwin
```

We also provide a [Docker image](https://hub.docker.com/r/messense/cargo-xwin) which has wine pre-installed in addition to cargo-xwin and Rust,
for example to build for x86_64 Windows:

```bash
docker run --rm -it -v $(pwd):/io -w /io messense/cargo-xwin \
  cargo xwin build --release --target x86_64-pc-windows-msvc
```

## Usage

1. Install Rust Windows msvc target via rustup, for example, `rustup target add x86_64-pc-windows-msvc`
2. Run `cargo xwin build`, for example, `cargo xwin build --target x86_64-pc-windows-msvc`

### Run tests with wine

With wine installed, you can run tests with the `cargo xwin test` command,
for example, `cargo xwin test --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                                                                      |
| `XWIN_INCLUDE_DEBUG_LIBS` | `--xwin-include-debug-libs` | Whether or not to include debug libs in installation (default false).                                              |

### CMake Support

Some Rust crates use the [cmake](https://github.com/alexcrichton/cmake-rs) crate to build C/C++ dependencies,
cargo-xwin will generate a [CMake toolchain](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html) file
automatically to make cross compilation work out of the box.

**[ninja](https://ninja-build.org/) 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](./LICENSE) file.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cargo-xwin",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": null,
    "keywords": "windows,cargo,msvc",
    "author": null,
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# cargo-xwin\n\n_formerly cargo-xwinbuild_\n\n[![CI](https://github.com/rust-cross/cargo-xwin/workflows/CI/badge.svg)](https://github.com/rust-cross/cargo-xwin/actions?query=workflow%3ACI)\n[![Crates.io](https://img.shields.io/crates/v/cargo-xwin.svg)](https://crates.io/crates/cargo-xwin)\n[![docs.rs](https://docs.rs/cargo-xwin/badge.svg)](https://docs.rs/cargo-xwin/)\n[![PyPI](https://img.shields.io/pypi/v/cargo-xwin.svg)](https://pypi.org/project/cargo-xwin)\n[![Docker Image](https://img.shields.io/docker/pulls/messense/cargo-xwin.svg?maxAge=2592000)](https://hub.docker.com/r/messense/cargo-xwin/)\n\n> \ud83d\ude80 Help me to become a full-time open-source developer by [sponsoring me on GitHub](https://github.com/sponsors/messense)\n\nCross compile Cargo project to Windows msvc target with ease.\n\n**By using this software you are consented to accept the license at [https://go.microsoft.com/fwlink/?LinkId=2086102](https://go.microsoft.com/fwlink/?LinkId=2086102)**\n\n## Prerequisite\n\n1. For pure Rust project, no prerequisites needed.\n2. For C/C++ dependencies, install [clang](https://clang.llvm.org/) (On macOS run `brew install llvm` and you're good to go).\n3. For assembly dependencies, install `llvm-tools-preview` component via `rustup component add llvm-tools-preview` or install [llvm](https://llvm.org).\n\n## Installation\n\n```bash\ncargo install cargo-xwin\n```\n\nYou can also install it using pip:\n\n```bash\npip install cargo-xwin\n```\n\nWe also provide a [Docker image](https://hub.docker.com/r/messense/cargo-xwin) which has wine pre-installed in addition to cargo-xwin and Rust,\nfor example to build for x86_64 Windows:\n\n```bash\ndocker run --rm -it -v $(pwd):/io -w /io messense/cargo-xwin \\\n  cargo xwin build --release --target x86_64-pc-windows-msvc\n```\n\n## Usage\n\n1. Install Rust Windows msvc target via rustup, for example, `rustup target add x86_64-pc-windows-msvc`\n2. Run `cargo xwin build`, for example, `cargo xwin build --target x86_64-pc-windows-msvc`\n\n### Run tests with wine\n\nWith wine installed, you can run tests with the `cargo xwin test` command,\nfor example, `cargo xwin test --target x86_64-pc-windows-msvc`\n\n### Customization\n\nThe Microsoft CRT and Windows SDK can be customized using the following environment variables or CLI options.\n\n| Environment Variable      | CLI option                  | Description                                                                                                        |\n| ------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------ |\n| `XWIN_ARCH`               | `--xwin-arch`               | The architectures to include, defaults to `x86_64,aarch64`, possible values: x86, x86_64, aarch, aarch64           |\n| `XWIN_VARIANT`            | `--xwin-variant`            | The variants to include, defaults to `desktop`, possible values: desktop, onecore, spectre                         |\n| `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 |\n| `XWIN_CACHE_DIR`          | `--xwin-cache-dir`          | xwin cache directory to put CRT and SDK files                                                                      |\n| `XWIN_INCLUDE_DEBUG_LIBS` | `--xwin-include-debug-libs` | Whether or not to include debug libs in installation (default false).                                              |\n\n### CMake Support\n\nSome Rust crates use the [cmake](https://github.com/alexcrichton/cmake-rs) crate to build C/C++ dependencies,\ncargo-xwin will generate a [CMake toolchain](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html) file\nautomatically to make cross compilation work out of the box.\n\n**[ninja](https://ninja-build.org/) is required** to enable CMake support.\n\n## License\n\nThis work is released under the MIT license. A copy of the license is provided\nin the [LICENSE](./LICENSE) file.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Cross compile Cargo project to Windows MSVC target with ease",
    "version": "0.16.4",
    "project_urls": {
        "Source Code": "https://github.com/rust-cross/cargo-xwin"
    },
    "split_keywords": [
        "windows",
        "cargo",
        "msvc"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "312e61d29f871ad87da9fffde9838f8d4b4aa311205d01e6ca65890aea5e00d5",
                "md5": "2f31be0de418ff4ffd3bed32c089895c",
                "sha256": "0efbe456f4cf3d1e8861b3b076acc02c39d12fb15c1ac3201fbc593136ecff66"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.16.4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "has_sig": false,
            "md5_digest": "2f31be0de418ff4ffd3bed32c089895c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7683737,
            "upload_time": "2024-02-01T13:19:34",
            "upload_time_iso_8601": "2024-02-01T13:19:34.346745Z",
            "url": "https://files.pythonhosted.org/packages/31/2e/61d29f871ad87da9fffde9838f8d4b4aa311205d01e6ca65890aea5e00d5/cargo_xwin-0.16.4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ba61c8e2bea92671fbff3525f62d50e01487eec97f21ca9e08e7eedd713d16de",
                "md5": "184ca8d3151469f76576a52adf958c60",
                "sha256": "74e5fa28929e173c08fd2f9ab485ccca11e9695420a811aa4b2609b1eb95ba4b"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.16.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "184ca8d3151469f76576a52adf958c60",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5387088,
            "upload_time": "2024-02-01T13:19:36",
            "upload_time_iso_8601": "2024-02-01T13:19:36.355459Z",
            "url": "https://files.pythonhosted.org/packages/ba/61/c8e2bea92671fbff3525f62d50e01487eec97f21ca9e08e7eedd713d16de/cargo_xwin-0.16.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3719b42c8591d10a1f92093affc30349cd3a8edb94229746e1b1068779593fc4",
                "md5": "56dead0fcdd5aacc4c4f106d67561a1f",
                "sha256": "726d0aa8e374177383812d756072fe6a0496da526f4e9764dbf931f6a45cd36c"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.16.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "has_sig": false,
            "md5_digest": "56dead0fcdd5aacc4c4f106d67561a1f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5600961,
            "upload_time": "2024-02-01T13:19:38",
            "upload_time_iso_8601": "2024-02-01T13:19:38.324438Z",
            "url": "https://files.pythonhosted.org/packages/37/19/b42c8591d10a1f92093affc30349cd3a8edb94229746e1b1068779593fc4/cargo_xwin-0.16.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e722b75762c34e0c874e9fb3d165c8921bc402f64e2b72ad2b69187522a4450f",
                "md5": "03b1fbe02b26b3a91c439a1006a7bb36",
                "sha256": "3b5467f42641022c972a9b4dc3c36eeed7a7f9674d41c5e6ac27a8d5abe6cf8b"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.16.4-py3-none-manylinux_2_5_i686.manylinux1_i686.whl",
            "has_sig": false,
            "md5_digest": "03b1fbe02b26b3a91c439a1006a7bb36",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5824335,
            "upload_time": "2024-02-01T13:19:40",
            "upload_time_iso_8601": "2024-02-01T13:19:40.540539Z",
            "url": "https://files.pythonhosted.org/packages/e7/22/b75762c34e0c874e9fb3d165c8921bc402f64e2b72ad2b69187522a4450f/cargo_xwin-0.16.4-py3-none-manylinux_2_5_i686.manylinux1_i686.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7b1594372f2a3e21d63fcd83937eccb8f9fb77960ec5537e9e72d52289166604",
                "md5": "07ff50cf6fe6a929146b096eb3319051",
                "sha256": "eb8cf91bd54e4b994d03dbf06777d49408b86e262696c8b4f62bc7f4c3e10ce1"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.16.4-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "07ff50cf6fe6a929146b096eb3319051",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5753434,
            "upload_time": "2024-02-01T13:19:42",
            "upload_time_iso_8601": "2024-02-01T13:19:42.850924Z",
            "url": "https://files.pythonhosted.org/packages/7b/15/94372f2a3e21d63fcd83937eccb8f9fb77960ec5537e9e72d52289166604/cargo_xwin-0.16.4-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4172c261e448e970316f2680903390b4cef7c5fb25d70711d339d6b1853c18e8",
                "md5": "63865ef2699f7eb65b78fafa21a1f1f9",
                "sha256": "3338fef15647e00dc35f07fc73c5f046a16c4116d22d2e8fc5042c8bf817903b"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.16.4-py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "63865ef2699f7eb65b78fafa21a1f1f9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3068981,
            "upload_time": "2024-02-01T13:19:44",
            "upload_time_iso_8601": "2024-02-01T13:19:44.471606Z",
            "url": "https://files.pythonhosted.org/packages/41/72/c261e448e970316f2680903390b4cef7c5fb25d70711d339d6b1853c18e8/cargo_xwin-0.16.4-py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9d596bdcf610235efdca266cec30143251ba7437ef42b9235cca6cb486f3c45b",
                "md5": "b9a2f0bebb9d3da7791fcc377de9600a",
                "sha256": "de29ea68ef5396eb946a2c5dae476d3bf2cceb262690cc5f46aa23c48a99bc6e"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.16.4-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "b9a2f0bebb9d3da7791fcc377de9600a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3472968,
            "upload_time": "2024-02-01T13:19:46",
            "upload_time_iso_8601": "2024-02-01T13:19:46.232520Z",
            "url": "https://files.pythonhosted.org/packages/9d/59/6bdcf610235efdca266cec30143251ba7437ef42b9235cca6cb486f3c45b/cargo_xwin-0.16.4-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-01 13:19:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rust-cross",
    "github_project": "cargo-xwin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cargo-xwin"
}
        
Elapsed time: 0.21973s