cargo: statically link binary on Windows/MSVC

Before this change, rg.exe depended on vcruntime140.dll, which does not
exist on a fresh install of Windows.

Closes #1613
This commit is contained in:
Austin Wise
2020-06-09 14:18:49 -07:00
committed by Andrew Gallant
parent 7534d5144f
commit 46d0130597
3 changed files with 13 additions and 9 deletions

8
.cargo/config.toml Normal file
View File

@@ -0,0 +1,8 @@
# On Windows MSVC, statically link the C runtime so that the resulting EXE does
# not depend on the vcruntime DLL.
#
# See: https://github.com/BurntSushi/ripgrep/pull/1613
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]