diff options
author | Scott Graham <scottmg@chromium.org> | 2015-06-18 22:41:47 (GMT) |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2015-06-18 22:41:47 (GMT) |
commit | fd4b140467887be6cb96154d28b9636fe387c69d (patch) | |
tree | 5720c9a8ea1089a66c63ed39fd2a76ffe31c5197 /src/msvc_helper-win32.cc | |
parent | 38aba9dbe68b800038f1cefc827362c126c7b212 (diff) | |
download | Ninja-fd4b140467887be6cb96154d28b9636fe387c69d.zip Ninja-fd4b140467887be6cb96154d28b9636fe387c69d.tar.gz Ninja-fd4b140467887be6cb96154d28b9636fe387c69d.tar.bz2 |
propagate include normalization failure to caller instead
Diffstat (limited to 'src/msvc_helper-win32.cc')
-rw-r--r-- | src/msvc_helper-win32.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/msvc_helper-win32.cc b/src/msvc_helper-win32.cc index a52dd38..78b79b0 100644 --- a/src/msvc_helper-win32.cc +++ b/src/msvc_helper-win32.cc @@ -82,9 +82,8 @@ bool CLParser::FilterInputFilename(string line) { EndsWith(line, ".cpp"); } -string CLParser::Parse(const string& output, const string& deps_prefix) { - string filtered_output; - +bool CLParser::Parse(const string& output, const string& deps_prefix, + string* filtered_output, string* err) { // Loop over all lines in the output to process them. size_t start = 0; while (start < output.size()) { @@ -96,11 +95,8 @@ string CLParser::Parse(const string& output, const string& deps_prefix) { string include = FilterShowIncludes(line, deps_prefix); if (!include.empty()) { string normalized; - string err; - if (!IncludesNormalize::Normalize(include, NULL, &normalized, &err)) { - Fatal("failed to normalize path: %s: %s\n", include.c_str(), - err.c_str()); - } + if (!IncludesNormalize::Normalize(include, NULL, &normalized, err)) + return false; if (!IsSystemInclude(normalized)) includes_.insert(normalized); } else if (FilterInputFilename(line)) { @@ -108,8 +104,8 @@ string CLParser::Parse(const string& output, const string& deps_prefix) { // TODO: if we support compiling multiple output files in a single // cl.exe invocation, we should stash the filename. } else { - filtered_output.append(line); - filtered_output.append("\n"); + filtered_output->append(line); + filtered_output->append("\n"); } if (end < output.size() && output[end] == '\r') @@ -119,7 +115,7 @@ string CLParser::Parse(const string& output, const string& deps_prefix) { start = end; } - return filtered_output; + return true; } int CLWrapper::Run(const string& command, string* output) { |