qmake: Separate object_script by Makefile name

If several Makefiles are used in the same directory (for example, for
multiple projects in the same directory or different build configurations),
they all reference the same object_script, which is obviously wrong.

Change-Id: I9b499ceb6b6bd6058f54b452fa44bfb2313eec26
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Orgad Shaneh 2017-06-22 10:49:34 +03:00 committed by Orgad Shaneh
parent db404fea64
commit e10be52e21

View File

@ -292,6 +292,8 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
if (!var("BUILD_NAME").isEmpty()) {
ar_script_file += "." + var("BUILD_NAME");
}
if (!var("MAKEFILE").isEmpty())
ar_script_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);
@ -304,6 +306,8 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME");
}
if (!var("MAKEFILE").isEmpty())
ld_script_file += "." + var("MAKEFILE");
createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
objectsLinkLine = escapeFilePath(ld_script_file);
}