diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-02 13:34:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-02 13:34:14 +0200 |
commit | 1ae0cd48961c6340fe16dc62d888096773d57cc0 (patch) | |
tree | 8ce7c8862d448b2cb4853f28f6ce7ccac4f00916 /build2/cxx/msvc.cxx | |
parent | 9469a7be982f5ab17e201c0b62ee555720ac6303 (diff) |
Filter gratuitous VC cl.exe and link.exe messages
Diffstat (limited to 'build2/cxx/msvc.cxx')
-rw-r--r-- | build2/cxx/msvc.cxx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/build2/cxx/msvc.cxx b/build2/cxx/msvc.cxx index 294ac03..dcf7fee 100644 --- a/build2/cxx/msvc.cxx +++ b/build2/cxx/msvc.cxx @@ -2,6 +2,8 @@ // copyright : Copyright (c) 2014-2016 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file +#include <iostream> // cerr + #include <build2/scope> #include <build2/target> #include <build2/context> @@ -37,6 +39,47 @@ namespace build2 return m; } + // Filter cl.exe and link.exe noise. + // + void + msvc_filter_cl (ifdstream& is, const path& src) + { + // While it appears VC always prints the source name (event if the + // file does not exist), let's do a sanity check. + // + string l; + if (getline (is, l) && l != src.leaf ().string ()) + cerr << l << endl; + } + + void + msvc_filter_link (ifdstream& is, const file& t, otype lt) + { + // Filter lines until we encounter something we don't recognize. We also + // have to assume the messages can be translated. + // + for (string l; getline (is, l); ) + { + // " Creating library foo\foo.dll.lib and object foo\foo.dll.exp" + // + if (lt == otype::s && l.compare (0, 3, " ") == 0) + { + path imp (static_cast<file*> (t.member)->path ().leaf ()); + + if (l.find (imp.string ()) != string::npos && + l.find (imp.base ().string () + ".exp") != string::npos) + continue; + } + + // /INCREMENTAL causes linker to sometimes issue messages but now I + // can't quite reproduce it. + // + + cerr << l << endl; + break; + } + } + // Extract system library search paths from MSVC. // void |