Allow static linking against the VC runtime

This commit is contained in:
Christopher Gundler 2021-09-27 15:01:48 +02:00 committed by Thom Chiovoloni
parent 8a88ba647c
commit e2af87f747

View File

@ -221,6 +221,11 @@ mod build_bundled {
cfg.flag("-fsanitize=address"); cfg.flag("-fsanitize=address");
} }
// If explicitly requested: enable static linking against the Microsoft Visual C++ Runtime to avoid dependencies on vcruntime140.dll and similar libraries.
if cfg!(target_feature = "crt-static") && is_compiler("msvc") {
cfg.static_crt(true);
}
// Older versions of visual studio don't support c99 (including isnan), which // Older versions of visual studio don't support c99 (including isnan), which
// causes a build failure when the linker fails to find the `isnan` // causes a build failure when the linker fails to find the `isnan`
// function. `sqlite` provides its own implementation, using the fact // function. `sqlite` provides its own implementation, using the fact