{"id":13611726,"url":"https://github.com/rust-cross/cargo-xwin","last_synced_at":"2025-04-13T05:33:29.425Z","repository":{"id":37666917,"uuid":"464438092","full_name":"rust-cross/cargo-xwin","owner":"rust-cross","description":"Cross compile Cargo project to Windows MSVC target with ease","archived":false,"fork":false,"pushed_at":"2025-01-13T11:30:38.000Z","size":677,"stargazers_count":410,"open_issues_count":1,"forks_count":30,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T08:03:53.280Z","etag":null,"topics":["cargo-subcommand","cargo-xwin","clang-cl","lld","lld-link","msvc","xwin","xwinbuild"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-cross.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"messense"}},"created_at":"2022-02-28T10:33:06.000Z","updated_at":"2025-03-21T12:29:40.000Z","dependencies_parsed_at":"2023-11-19T09:26:22.657Z","dependency_job_id":"2f50ae83-2eff-4e8e-a3f7-3456b4824ee4","html_url":"https://github.com/rust-cross/cargo-xwin","commit_stats":{"total_commits":169,"total_committers":5,"mean_commits":33.8,"dds":"0.023668639053254448","last_synced_commit":"0e6922fcfab6899cf07b127beba35a9fd6045ad6"},"previous_names":["messense/cargo-xwinbuild"],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Fcargo-xwin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Fcargo-xwin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Fcargo-xwin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Fcargo-xwin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-cross","download_url":"https://codeload.github.com/rust-cross/cargo-xwin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670513,"owners_count":21142896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo-subcommand","cargo-xwin","clang-cl","lld","lld-link","msvc","xwin","xwinbuild"],"created_at":"2024-08-01T19:02:02.144Z","updated_at":"2025-04-13T05:33:29.414Z","avatar_url":"https://github.com/rust-cross.png","language":"Rust","funding_links":["https://github.com/sponsors/messense"],"categories":["Rust"],"sub_categories":[],"readme":"# 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\u003e 🚀 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 `\u003cmajor\u003e.\u003cminor\u003e` 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-cross%2Fcargo-xwin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-cross%2Fcargo-xwin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-cross%2Fcargo-xwin/lists"}