aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-05-17 19:03:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-05-17 19:03:37 +0200
commit4fe4e34b4e0e57719872c61bd5930364e3163fc0 (patch)
treeb63ce7a7de4cd4b144de939ee4c02878193aa7a3 /build2
parentaaf2525e9e8ed356feba437e56df737428a52f55 (diff)
Use correct stream for VC /P diagnostics
Diffstat (limited to 'build2')
-rw-r--r--build2/cc/compile.cxx11
1 files 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;