From 4fe4e34b4e0e57719872c61bd5930364e3163fc0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 May 2017 19:03:37 +0200 Subject: Use correct stream for VC /P diagnostics --- build2/cc/compile.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 1eb4c9b..35fb531 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -1236,7 +1236,7 @@ namespace build2 // args[i] = "-M"; args[i + 1] = "-MG"; - args[i + 2] = src.path ().string ().c_str (); + args[i + 2] = rels.string ().c_str (); args[i + 3] = nullptr; if (cid == "gcc") @@ -1621,13 +1621,13 @@ namespace build2 assert (!sense_diag); // For VC with /P the dependency info and diagnostics all go - // to stdout. + // to stderr so redirect it to stdout. // pr = process (*xc, args.data (), 0, -1, - gen ? 2 : -2); + cid == "msvc" ? 1 : gen ? 2 : -2); } else { @@ -1674,8 +1674,7 @@ namespace build2 bool good_error (false), bad_error (false); size_t skip (skip_count); - for (bool first (true), second (false); - !(restart || is.eof ()); ) + for (bool first (true), second (false); !(restart || is.eof ());) { string l; getline (is, l); @@ -1702,7 +1701,7 @@ namespace build2 // this case the first line (and everything after it) is // presumably diagnostics. // - if (l != src.path ().leaf ().string ()) + if (l != rels.leaf ().string ()) { text << l; bad_error = true; -- cgit v1.1