cargo-xwin


Namecargo-xwin JSON
Version 0.18.0 PyPI version JSON
download
home_pageNone
SummaryCross compile Cargo project to Windows MSVC target with ease
upload_time2024-12-21 11:07:35
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
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 using [xwin](https://github.com/Jake-Shadle/xwin) or [windows-msvc-sysroot](https://github.com/trcrsired/windows-msvc-sysroot).

**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. Install [clang](https://clang.llvm.org/) (On macOS run `brew install llvm` and you're good to go).
2. For assembly dependencies, install `llvm-tools` component via `rustup component add llvm-tools` or install [llvm](https://llvm.org).

A full LLVM installation is recommended to avoid possible issues.

## Installation

```bash
cargo install --locked 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_CROSS_COMPILER`        | `cross-compiler`               | The cross compiler to use, defaults to `clang-cl`, possible values: `clang-cl`, `clang`                            |
| `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).                                              |
| `XWIN_INCLUDE_DEBUG_SYMBOLS` | `--xwin-include-debug-symbols` | Whether or not to include debug symbols (PDBs) 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": null,
    "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 using [xwin](https://github.com/Jake-Shadle/xwin) or [windows-msvc-sysroot](https://github.com/trcrsired/windows-msvc-sysroot).\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. Install [clang](https://clang.llvm.org/) (On macOS run `brew install llvm` and you're good to go).\n2. For assembly dependencies, install `llvm-tools` component via `rustup component add llvm-tools` or install [llvm](https://llvm.org).\n\nA full LLVM installation is recommended to avoid possible issues.\n\n## Installation\n\n```bash\ncargo install --locked 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_CROSS_COMPILER`        | `cross-compiler`               | The cross compiler to use, defaults to `clang-cl`, possible values: `clang-cl`, `clang`                            |\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| `XWIN_INCLUDE_DEBUG_SYMBOLS` | `--xwin-include-debug-symbols` | Whether or not to include debug symbols (PDBs) 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.18.0",
    "project_urls": {
        "Source Code": "https://github.com/rust-cross/cargo-xwin"
    },
    "split_keywords": [
        "windows",
        " cargo",
        " msvc"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e8fb993ed5b6c0e809d2937e243b7a4a3026bbd46099f10f8bcdaa751c412025",
                "md5": "0b7cfcaf1eb8d199655b2936744d10e3",
                "sha256": "1e7b32766114c0fa1047d450b45855bb4f5d142d7dcd155edb2881f1deab0d70"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.18.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "has_sig": false,
            "md5_digest": "0b7cfcaf1eb8d199655b2936744d10e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8100237,
            "upload_time": "2024-12-21T11:07:35",
            "upload_time_iso_8601": "2024-12-21T11:07:35.280400Z",
            "url": "https://files.pythonhosted.org/packages/e8/fb/993ed5b6c0e809d2937e243b7a4a3026bbd46099f10f8bcdaa751c412025/cargo_xwin-0.18.0-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": "4c06b0725bb1ade034f5845672cdaee442c6ae49bee3f243d39579773be56332",
                "md5": "7c3e855140e9cd2cac08d8748db752c2",
                "sha256": "7256b65cb7cf2a044b95de520bc0dfd3aeb32c49cc58728e24fa775064c853a6"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.18.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "7c3e855140e9cd2cac08d8748db752c2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4326208,
            "upload_time": "2024-12-21T11:07:38",
            "upload_time_iso_8601": "2024-12-21T11:07:38.714747Z",
            "url": "https://files.pythonhosted.org/packages/4c/06/b0725bb1ade034f5845672cdaee442c6ae49bee3f243d39579773be56332/cargo_xwin-0.18.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "73a6a949cae4196a5b88e1616ecdb5bd0d8325dea993f884bbcf227215f3257a",
                "md5": "3a43c05a3fa63ce6927401c5564ed01f",
                "sha256": "4b292828a72a8fe390b52771f1b211ef6911b21c9f782c1d7ff505644e2599c9"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.18.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "has_sig": false,
            "md5_digest": "3a43c05a3fa63ce6927401c5564ed01f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4106417,
            "upload_time": "2024-12-21T11:07:41",
            "upload_time_iso_8601": "2024-12-21T11:07:41.637395Z",
            "url": "https://files.pythonhosted.org/packages/73/a6/a949cae4196a5b88e1616ecdb5bd0d8325dea993f884bbcf227215f3257a/cargo_xwin-0.18.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2a69dd4c13414b80c53997a58575169c250c890a6312f2657a3d1120d3f9cb8f",
                "md5": "6d081c2d56d5631c0e5a16e65e82aead",
                "sha256": "f5e4d9654af76b49b3f001ade41b7606ceebd4252bda283a6722e433871ca3a4"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.18.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl",
            "has_sig": false,
            "md5_digest": "6d081c2d56d5631c0e5a16e65e82aead",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4347845,
            "upload_time": "2024-12-21T11:07:44",
            "upload_time_iso_8601": "2024-12-21T11:07:44.725082Z",
            "url": "https://files.pythonhosted.org/packages/2a/69/dd4c13414b80c53997a58575169c250c890a6312f2657a3d1120d3f9cb8f/cargo_xwin-0.18.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fe8996a1c89bd4b480b4936da4422b5277be06e4ff195c815468bba8113c3357",
                "md5": "81d208a0f3578327acb8786dd0a79410",
                "sha256": "a88c9f567139c42d2993074b483fbc26c200f369e2295530c0aabd371d650135"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.18.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "81d208a0f3578327acb8786dd0a79410",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4577179,
            "upload_time": "2024-12-21T11:07:47",
            "upload_time_iso_8601": "2024-12-21T11:07:47.763549Z",
            "url": "https://files.pythonhosted.org/packages/fe/89/96a1c89bd4b480b4936da4422b5277be06e4ff195c815468bba8113c3357/cargo_xwin-0.18.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9da367bd7677b0ee1e9ae82cd3e78940b4e299ecd96386ace90cf591d71b27ac",
                "md5": "3f48d30d5c2e7d75d93132365627436b",
                "sha256": "ee3818a2ef8c5915f099b0d812ca09d8dfb05c0befba780add5c236a9dc21e3c"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.18.0-py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "3f48d30d5c2e7d75d93132365627436b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3219383,
            "upload_time": "2024-12-21T11:07:50",
            "upload_time_iso_8601": "2024-12-21T11:07:50.556631Z",
            "url": "https://files.pythonhosted.org/packages/9d/a3/67bd7677b0ee1e9ae82cd3e78940b4e299ecd96386ace90cf591d71b27ac/cargo_xwin-0.18.0-py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "850ff0294787b30036f2d6eb5db53841744fcb5baf9bc6d5873b79f29a769f8f",
                "md5": "1410ac55844cde2f48f8a9c9c481cd54",
                "sha256": "ddb04a3c193bcb49cbbf7da728a938fc355c719ec5baf1bd4e5742653b1f64b0"
            },
            "downloads": -1,
            "filename": "cargo_xwin-0.18.0-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "1410ac55844cde2f48f8a9c9c481cd54",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3693791,
            "upload_time": "2024-12-21T11:07:52",
            "upload_time_iso_8601": "2024-12-21T11:07:52.242004Z",
            "url": "https://files.pythonhosted.org/packages/85/0f/f0294787b30036f2d6eb5db53841744fcb5baf9bc6d5873b79f29a769f8f/cargo_xwin-0.18.0-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-21 11:07:35",
    "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.41693s