aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-25 14:50:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-01-25 14:50:46 +0200
commit7b8055286bec7ee17575c572fe954c88b103419a (patch)
tree8882ec29e4dd1ef1207ca6e866ef343158456daf
parent3499ddd4ef5eeb7e274cbdf618cc53bf62939d14 (diff)
Don't treat VC non-existent main source file as non-existent header
-rw-r--r--build2/cc/compile.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx
index 6bb3d9a..94b3478 100644
--- a/build2/cc/compile.cxx
+++ b/build2/cc/compile.cxx
@@ -1289,6 +1289,11 @@ namespace build2
// is an error. Should be robust enough in the face of language
// translation, etc.
//
+ // It turns out C1083 is also used when we are unable to open the main
+ // source file and the error line looks like this:
+ //
+ // c1xx: fatal error C1083: Cannot open source file: 's.cpp': No such
+ // file or directory
// Sense whether this is an include note (return npos) or a diagnostics
// line (return postion of the NNNN code in CNNNN).
@@ -1368,7 +1373,8 @@ namespace build2
return string (l, p);
}
- else if (l.compare (p, 4, "1083") == 0)
+ else if (l.compare (p, 4, "1083") == 0 &&
+ l.compare (0, 5, "c1xx:") != 0 /* Not the main source file. */ )
{
// Include error. The path is conveniently quoted with ''.
//