Don't add -nostdinc flag just because popen succeeded, make sure we got what we were looking for first.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
This commit is contained in:
Frederich Munch 2016-08-12 20:07:55 -04:00 committed by sftnight
parent 6e23bb5f1e
commit eeb1e10e8b

View File

@ -498,7 +498,6 @@ namespace {
"| GREP_OPTIONS= grep -E \"(c|g)\\+\\+\"";
if (FILE *pf = ::popen(CppInclQuery, "r")) {
HostCXXI.push_back("-nostdinc++");
char buf[2048];
while (fgets(buf, sizeof(buf), pf) && buf[0]) {
size_t lenbuf = strlen(buf);
@ -523,7 +522,9 @@ namespace {
"results in\n";
int ExitCode = system(CppInclQuery);
llvm::errs() << "with exit code " << ExitCode << "\n";
}
} else
HostCXXI.push_back("-nostdinc++");
#endif // _MSC_VER
}