Chromium Code Reviews| Index: build/config/win/BUILD.gn |
| diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn |
| index b437516d6639ba7566e01db5ad14361f59fb2444..983eb6fac64a9e9fffe975a0336af1b4c16bec45 100644 |
| --- a/build/config/win/BUILD.gn |
| +++ b/build/config/win/BUILD.gn |
| @@ -193,33 +193,6 @@ config("runtime_library") { |
| # However it is prohibited when using /analyze |
| defines += [ "_USING_V110_SDK71_" ] |
| } |
| - |
| - 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. |
| - if (is_debug) { |
| - cflags += [ "/MDd" ] |
| - } else { |
| - cflags += [ "/MD" ] |
| - } |
| - } else { |
| - if (current_os != "win") { |
| - # WindowsRT: use the dynamic CRT. |
| - if (is_debug) { |
| - cflags += [ "/MDd" ] |
| - } else { |
| - cflags += [ "/MD" ] |
| - } |
| - } else { |
| - # Desktop Windows: static CRT. |
| - if (is_debug) { |
| - cflags += [ "/MTd" ] |
| - } else { |
| - cflags += [ "/MT" ] |
| - } |
| - } |
| - } |
| } |
| # Sets the default Windows build version. This is separated because some |
| @@ -291,6 +264,44 @@ config("common_linker_setup") { |
| } |
| } |
| +# CRT -------------------------------------------------------------------------- |
| + |
| +# 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. |
| + config = [ ":dynamic_crt" ] |
|
brettw
2016/09/28 18:03:54
Does this work? These should read "configs".
|
| + } else { |
| + if (current_os != "win") { |
| + # WindowsRT: use the dynamic CRT. |
| + config = [ ":dynamic_crt" ] |
| + } else { |
| + # Desktop Windows: static CRT. |
| + config = [ ":static_crt" ] |
| + } |
| + } |
| +} |
| + |
| +config("dynamic_crt") { |
| + if (is_debug) { |
| + cflags = [ "/MDd" ] |
| + } else { |
| + cflags = [ "/MD" ] |
| + } |
| +} |
| + |
| +config("static_crt") { |
| + if (is_debug) { |
| + cflags = [ "/MTd" ] |
| + } else { |
| + cflags = [ "/MT" ] |
| + } |
| +} |
| + |
| # Subsystem -------------------------------------------------------------------- |
| # This is appended to the subsystem to specify a minimum version. |