summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-07-30 13:47:36 +0200
committerLiang Qi <liang.qi@qt.io>2019-07-30 13:47:36 +0200
commit71ec1d6d79c16c46837dbd10f1cd2a53027a6682 (patch)
tree5008d058a0ea3ef379c36ad2364d9b2bc78f3aaf /qmake/generators/win32
parent31753adebe0f19b90f332e81e1a9b063b40f982d (diff)
parent75f51d2f40746205484b969a72a56d75d5d8ff39 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: qmake/generators/win32/mingw_make.cpp Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/mingw_make.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 6f80b93307..37bf5e8669 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -127,7 +127,7 @@ QString MingwMakefileGenerator::installRoot() const
return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)");
}
-void createLdResponseFile(const QString &fileName, const ProStringList &objList)
+static void createResponseFile(const QString &fileName, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
@@ -151,23 +151,6 @@ void createLdResponseFile(const QString &fileName, const ProStringList &objList)
}
}
-void createArObjectScriptFile(const QString &fileName, const QString &target, const ProStringList &objList)
-{
- QString filePath = Option::output_dir + QDir::separator() + fileName;
- QFile file(filePath);
- if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QTextStream t(&file);
- // ### quoting?
- t << "CREATE " << target << Qt::endl;
- for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
- t << "ADDMOD " << *it << Qt::endl;
- }
- t << "SAVE\n";
- t.flush();
- file.close();
- }
-}
-
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
writeStandardParts(t);
@@ -294,26 +277,25 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) {
objectsLinkLine = "$(OBJECTS)";
} else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
- QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
+ QString ar_response_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
- ar_script_file += "." + var("BUILD_NAME");
+ ar_response_file += "." + var("BUILD_NAME");
}
if (!var("MAKEFILE").isEmpty())
- ar_script_file += "." + var("MAKEFILE");
+ ar_response_file += "." + var("MAKEFILE");
// QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix.
- // Strip off any options since the ar commands will be read from file.
- QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);
+ QString ar_cmd = var("QMAKE_LIB");
if (ar_cmd.isEmpty())
- ar_cmd = "ar";
- createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
- objectsLinkLine = ar_cmd + " -M < " + escapeFilePath(ar_script_file);
+ ar_cmd = "ar -rc";
+ createResponseFile(ar_response_file, project->values("OBJECTS"));
+ objectsLinkLine = ar_cmd + ' ' + var("DEST_TARGET") + " @" + escapeFilePath(ar_response_file);
} else {
QString ld_response_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty())
ld_response_file += "." + var("BUILD_NAME");
if (!var("MAKEFILE").isEmpty())
ld_response_file += "." + var("MAKEFILE");
- createLdResponseFile(ld_response_file, project->values("OBJECTS"));
+ createResponseFile(ld_response_file, project->values("OBJECTS"));
objectsLinkLine = "@" + escapeFilePath(ld_response_file);
}
Win32MakefileGenerator::writeObjectsPart(t);