diff options
author | Evan Martin <martine@danga.com> | 2012-08-12 21:52:18 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-08-12 21:52:18 (GMT) |
commit | 1843f550d9b8b6d271cefdfb5fffd150bb8ef069 (patch) | |
tree | 6d4e9aa59249d5397f954ba541333126c5d52f38 /src/msvc_helper.h | |
parent | 031237133e33ee4eb5e9641396d6b0f566b575c8 (diff) | |
download | Ninja-1843f550d9b8b6d271cefdfb5fffd150bb8ef069.zip Ninja-1843f550d9b8b6d271cefdfb5fffd150bb8ef069.tar.gz Ninja-1843f550d9b8b6d271cefdfb5fffd150bb8ef069.tar.bz2 |
add subprocess-spawning to msvc_helper
Rather than using subprocess.h, reimplement the subprocess code.
This allows:
1) using anonymous (instead of named) pipes
2) not using all the completion port craziness
3) printing the output as it happens
4) further variation, like adjusting the environment (in a forthcoming
change) without affecting the main subprocess code
Diffstat (limited to 'src/msvc_helper.h')
-rw-r--r-- | src/msvc_helper.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/msvc_helper.h b/src/msvc_helper.h index e7c2b1a..5a657be 100644 --- a/src/msvc_helper.h +++ b/src/msvc_helper.h @@ -23,7 +23,16 @@ struct StringPiece; /// format when building with /showIncludes. This class wraps a CL /// process and parses that output to extract the file list. struct CLWrapper { + /// Start a process and parse its output. Returns its exit code. + /// Any non-parsed output is buffered into \a extra_output if provided, + /// otherwise it is printed to stdout while the process runs. + /// Crashes (calls Fatal()) on error. + int Run(const string& command, string* extra_output=NULL); + /// Parse a line of cl.exe output and extract /showIncludes info. /// If a dependency is extracted, returns a nonempty string. + /// Exposed for testing. static string FilterShowIncludes(const string& line); + + vector<string> includes_; }; |