I was looking at a similar problem for WebRTC build with VS2019 on windows (x64).
The "src/build/config/win/BUILD.gn" file in this case seems to define different configs that can be used to control the type of linking used (MD, MT ...).
# Configures how the runtime library (CRT) is going to be used.
# See
https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx for a reference of
# what each value does.
config("default_crt") {
if (is_component_build) {
# Component mode: dynamic CRT. Since the library is shared, it requires
# exceptions or will give errors about things not matching, so keep
# exceptions on.
configs = [ ":dynamic_crt" ]
} else {
if (current_os == "winuwp") {
#
https://blogs.msdn.microsoft.com/vcblog/2014/06/10/the-great-c-runtime-crt-refactoring/ # contains a details explanation of what is happening with the Windows
# CRT in Visual Studio releases related to Windows store applications.
configs = [ ":dynamic_crt" ]
} else {
# Desktop Windows: static CRT.
configs = [ ":static_crt" ]
}
}
}
# Use this to force use of the release CRT when building perf-critical build
# tools that need to be fully optimized even in debug builds, for those times
# when the debug CRT is part of the bottleneck. This also avoids *implicitly*
# defining _DEBUG.
...
config("dynamic_crt") {
if (is_debug) {
# This pulls in the DLL debug CRT and defines _DEBUG
cflags = [ "/MDd" ]
} else {
cflags = [ "/MD" ]
}
}
config("static_crt") {
if (is_debug) {
# This pulls in the static debug CRT and defines _DEBUG
cflags = [ "/MTd" ]
} else {
cflags = [ "/MT" ]
}
}