aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/compile-rule.cxx
diff options
context:
space:
mode:
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