summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-03-13 13:49:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-03-13 13:52:32 +0200
commit8d8d7784d5fe0dc3cd8d7fbd4196c2337d389fd1 (patch)
tree5d99a016bf806869a08b2074deba53c1b223afa2
parent355534c22ab547bceae189e11ce36fa0dea4e743 (diff)
downloadbuild2-8d8d7784d5fe0dc3cd8d7fbd4196c2337d389fd1.zip
build2-8d8d7784d5fe0dc3cd8d7fbd4196c2337d389fd1.tar.gz
build2-8d8d7784d5fe0dc3cd8d7fbd4196c2337d389fd1.tar.xz
Don't preserve comments (/C) in MSVC preprocessed output
This appear to "enable" some additional VC preprocessor bug that are now triggered by the VC 16.0 xsmf_control.h header.
-rw-r--r--build2/cc/compile-rule.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx
index 4d6068d..eeaec83 100644
--- a/build2/cc/compile-rule.cxx
+++ b/build2/cc/compile-rule.cxx
@@ -1529,7 +1529,10 @@ namespace build2
}
case compiler_type::msvc:
{
- pp = "/C";
+ // Asking MSVC to preserve comments doesn't really buy us anything
+ // but does cause some extra buggy behavior.
+ //
+ //pp = "/C";
break;
}
case compiler_type::icc:
@@ -1909,8 +1912,6 @@ namespace build2
{
case compiler_class::msvc:
{
- assert (pp != nullptr);
-
args.push_back ("/nologo");
// See perform_update() for details on overriding the default
@@ -1924,7 +1925,8 @@ namespace build2
args.push_back ("/P"); // Preprocess to file.
args.push_back ("/showIncludes"); // Goes to stdout (with diag).
- args.push_back (pp); // /C (preserve comments).
+ if (pp != nullptr)
+ args.push_back (pp); // /C (preserve comments).
args.push_back ("/WX"); // Warning as error (see above).
msvc_sanitize_cl (args);
@@ -3009,7 +3011,7 @@ namespace build2
args.push_back ("/MD");
args.push_back ("/E");
- args.push_back ("/C");
+ // args.push_back ("/C"); // See above.
msvc_sanitize_cl (args);