Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2680)

Unified Diff: build/config/win/BUILD.gn

Issue 2379573003: [Windows] Pass "/MD" and variants outside the "runtime_library" target (Closed)
Patch Set: Fix another brainfart Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/win/BUILD.gn
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index b437516d6639ba7566e01db5ad14361f59fb2444..9b6ac7423f2b9d4d12bdea8302a200507d706e6e 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.
+ configs = [ ":dynamic_crt" ]
+ } else {
+ if (current_os != "win") {
+ # WindowsRT: use the dynamic CRT.
+ configs = [ ":dynamic_crt" ]
+ } else {
+ # Desktop Windows: static CRT.
+ configs = [ ":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.
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698