Skip to content

Commit

Permalink
Compile Windows releases with a static CRT (#247)
Browse files Browse the repository at this point in the history
This commit compiles all Rust code for the Windows release with
`-Ctarget-feature=+crt-static`. This is targeted at increasing the
binary compatibility of the binaries built to not rely on DLLs that
aren't always installed on Windows. Notably this statically links the C
runtime (notably used by the C++ code) and means that the final binary
relies on fewer dlls.

This in theory means that the binaries are only limited by the number of
APIs they use from Windows. Note that this also matches how we build
releases of Rust for MSVC.
  • Loading branch information
alexcrichton authored and tschneidereit committed Aug 6, 2019
1 parent 3e2344c commit 8ce6873
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .azure-pipelines.yml
Expand Up @@ -95,6 +95,9 @@ jobs:
matrix:
windows:
imageName: 'vs2017-win2016'
# Statically link against msvcrt to produce slightly more portable
# binaries on Windows by reducing our binary compatibility requirements.
RUSTFLAGS: -Ctarget-feature=+crt-static
linux:
imageName: 'ubuntu-16.04'
mac:
Expand Down

0 comments on commit 8ce6873

Please sign in to comment.