# `xwin` **A utility for downloading and packaging the [Microsoft CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?redirectedfrom=MSDN&view=msvc-160) headers and libraries, and [Windows SDK](https://en.wikipedia.org/wiki/Microsoft_Windows_SDK) headers and libraries needed for compiling and linking programs targeting Windows.** [![Crates.io](https://img.shields.io/crates/v/xwin.svg)](https://crates.io/crates/xwin) [![Docs](https://docs.rs/xwin/badge.svg)](https://docs.rs/xwin) [![dependency status](https://deps.rs/repo/github/Jake-Shadle/xwin/status.svg)](https://deps.rs/repo/github/Jake-Shadle/xwin) [![Build status](https://github.com/Jake-Shadle/xwin/workflows/CI/badge.svg)](https://github.com/Jake-Shadle/xwin/actions)

Introduction

The goal of this project is to create a root directory for both the CRT and Windows SDK that each contain all of the necessary includes and libraries needed for an application to compile and link from a non-Windows platform, using a native cross compiling toolchain like clang/LLVM. This includes adding symlinks to correct numerous casing issues in the Windows SDK so that the files generated by this program can function on a case-sensitive file system.

See this blog post for an in depth walk-through of how xwin can be used.

Installation

From source

cargo install xwin --locked

Features

xwin provides two feature toggles used to decide which TLS implementation to use

From tarball

You can download a prebuilt binary from the Releases.

Usage

xwin download

This downloads the top level manifest and any vsix, msi, or cab files that are needed that aren't already in the download cache.

xwin unpack

Decompresses all of the downloaded package contents to disk. download is run automatically.

xwin splat

This moves all of the unpacked files which aren't pruned to their canonical locations under a root directory, for example here is what an x86_64 Desktop splat looks like. unpack is run automatically as needed.

txt .xwin-cache/splat ├── crt │ ├── include │ │ ├── cliext │ │ ├── CodeAnalysis │ │ ├── cvt │ │ ├── experimental │ │ ├── Manifest │ │ └── msclr │ │ └── com │ └── lib │ └── x86_64 └── sdk ├── include │ ├── cppwinrt │ │ └── winrt │ │ └── impl │ ├── shared │ │ ├── ndis │ │ └── netcx │ │ └── shared │ │ └── net │ │ └── wifi │ ├── ucrt │ │ └── sys │ ├── um │ │ ├── alljoyn_c │ │ ├── gl │ │ ├── qcc │ │ │ └── windows │ │ └── winsqlite │ └── winrt │ └── wrl │ └── wrappers └── lib ├── ucrt │ └── x86_64 └── um └── x86_64

Container

xwin.dockerfile is an example Dockerfile that can be used a container image capable of building and testing Rust crates targeting x86_64-pc-windows-msvc.

Thanks

Special thanks to https://github.com/mstorsjo/msvc-wine for the inspiration and @mdsteele for publishing several Rust crates around msi/cab files that were needed in this project

License

This contribution is dual licensed under EITHER OF

at your option.