diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-01-04 14:35:24 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-01-08 18:08:12 +0100 |
commit | 41f211d25f655343e47f8928497abcc23ea8b29f (patch) | |
tree | beeffe546d2f87f2c8c9f80d7ec3726e9ab0b911 /qmake | |
parent | ae294a42f001a0fe8191f20627f22ddd0e8358ed (diff) |
qmake: Print error and exit if a response file cannot be created
This is always an error, and we should not silently return an empty
string and pretend that everything is in order.
Drive-by change: Add a comment stating what createResponseFile()
returns.
Pick-to: 6.3
Change-Id: I4ee940cfac826c7ae5d15e977b692f1368ab29ea
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/makefile.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 53d50f23f9..59dc24f022 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3492,6 +3492,9 @@ ProKey MakefileGenerator::fullTargetVariable() const return "TARGET"; } +/* + * Create a response file and return its file name. + */ QString MakefileGenerator::createResponseFile( const QString &baseName, const ProStringList &objList, @@ -3504,8 +3507,11 @@ QString MakefileGenerator::createResponseFile( fileName += '.' + var("MAKEFILE"); QString filePath = Option::output_dir + QDir::separator() + fileName; QFile file(filePath); - if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) - return QString(); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + fprintf(stderr, "Error: Cannot open response file '%s' for writing.\n", + qPrintable(filePath)); + exit(1); + } QTextStream t(&file); for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { QString path = (*it).toQString(); |