aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/compile-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-05 11:24:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-05 11:24:45 +0200
commitdf56d347a75151c7bd6a4d3837f62777cc0354ca (patch)
treef2c2c0e91e45cdd5e97fd38850e41798442047fe /build2/cc/compile-rule.cxx
parentfa05a1a11dc42b393c99059cd0705912b48b050d (diff)
Resolve /WN /Wall /w option overrides
Failed that, MSVC "helpfully" warns that one is overriding the other.
Diffstat (limited to 'build2/cc/compile-rule.cxx')
-rw-r--r--build2/cc/compile-rule.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx
index 720b9d0..437255e 100644
--- a/build2/cc/compile-rule.cxx
+++ b/build2/cc/compile-rule.cxx
@@ -1448,6 +1448,9 @@ namespace build2
}
}
+ void
+ msvc_sanitize_cl (cstrings&); // msvc.cxx
+
// Extract and inject header dependencies. Return the preprocessed source
// file as well as an indication if it is usable for compilation (see
// below for details).
@@ -1916,6 +1919,8 @@ namespace build2
args.push_back (pp); // /C (preserve comments).
args.push_back ("/WX"); // Warning as error (see above).
+ msvc_sanitize_cl (args);
+
psrc = auto_rmfile (t.path () + x_pext);
if (cast<uint64_t> (rs[x_version_major]) >= 18)
@@ -2984,6 +2989,9 @@ namespace build2
args.push_back ("/E");
args.push_back ("/C");
+
+ msvc_sanitize_cl (args);
+
args.push_back (langopt (md)); // Compile as.
break;
@@ -4331,6 +4339,8 @@ namespace build2
if (!find_option_prefixes ({"/MD", "/MT"}, args))
args.push_back ("/MD");
+ msvc_sanitize_cl (args);
+
append_modules (env, args, mods, a, t, md);
// The presence of /Zi or /ZI causes the compiler to write debug info