QMake: make it error out if it cannot open output files
Change-Id: I02c979e31f4208cbf9d590e043cf7f03eb4a39d6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
8414a0aa2c
commit
a0a990863f
@ -140,7 +140,10 @@ BuildsMetaMakefileGenerator::write()
|
||||
if(Option::output.fileName() == "-") {
|
||||
Option::output.setFileName("");
|
||||
Option::output_dir = qmake_getpwd();
|
||||
Option::output.open(stdout, QIODevice::WriteOnly | QIODevice::Text);
|
||||
if (!Option::output.open(stdout, QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
fprintf(stderr, "Failure to open stdout\n");
|
||||
return false;
|
||||
}
|
||||
using_stdout = true;
|
||||
} else {
|
||||
if(Option::output.fileName().isEmpty() &&
|
||||
|
@ -512,7 +512,10 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool)
|
||||
|
||||
QFile filterFile;
|
||||
filterFile.setFileName(Option::output.fileName().append(".filters"));
|
||||
filterFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
|
||||
if (!filterFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
|
||||
warn_msg(WarnLogic, "Generator: cannot open output filter file");
|
||||
return;
|
||||
}
|
||||
QTextStream ts(&filterFile);
|
||||
XmlOutput xmlFilter(ts, XmlOutput::NoConversion);
|
||||
|
||||
@ -751,7 +754,10 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
||||
// The file filters are added in a separate file for MSBUILD.
|
||||
QFile filterFile;
|
||||
filterFile.setFileName(Option::output.fileName().append(".filters"));
|
||||
filterFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
|
||||
if (filterFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
|
||||
warn_msg(WarnLogic, "Cannot open output filter file");
|
||||
return;
|
||||
}
|
||||
QTextStream ts(&filterFile);
|
||||
XmlOutput xmlFilter(ts, XmlOutput::NoConversion);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user