summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-10-19 08:10:08 (GMT)
committeraxis <qt-info@nokia.com>2011-03-04 10:43:13 (GMT)
commit153b79efac39c33e528650cca35f832e47f7302b (patch)
tree336d0982b5ecb7e8919ef8b07e18750ba5e844e3 /qmake/generators/win32
parentbd07beb56cda3d6c37c0d0f9204247f16586cd27 (diff)
downloadQt-153b79efac39c33e528650cca35f832e47f7302b.zip
Qt-153b79efac39c33e528650cca35f832e47f7302b.tar.gz
Qt-153b79efac39c33e528650cca35f832e47f7302b.tar.bz2
Added object script support to RVCT when using MinGW qmake generator.
RevBy: Oswald Buddenhagen
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/mingw_make.cpp46
1 files changed, 38 insertions, 8 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index ea9e9e1..006a7d5 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -199,6 +199,23 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
}
}
+void createRvctObjectScriptFile(const QString &fileName, const QStringList &objList)
+{
+ QString filePath = Option::output_dir + QDir::separator() + fileName;
+ QFile file(filePath);
+ if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ QTextStream t(&file);
+ for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ if (QDir::isRelativePath(*it))
+ t << "./" << *it << endl;
+ else
+ t << *it << endl;
+ }
+ t.flush();
+ file.close();
+ }
+}
+
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
writeStandardParts(t);
@@ -367,20 +384,33 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
if (!var("BUILD_NAME").isEmpty()) {
ar_script_file += "." + var("BUILD_NAME");
}
- createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
// 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);;
- if (ar_cmd.isEmpty())
- ar_cmd = "ar";
- objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
+ if (project->isActiveConfig("rvct_linker")) {
+ createRvctObjectScriptFile(ar_script_file, project->values("OBJECTS"));
+ QString ar_cmd = project->values("QMAKE_LIB").join(" ");
+ if (ar_cmd.isEmpty())
+ ar_cmd = "armar --create";
+ objectsLinkLine = ar_cmd + " " + var("DEST_TARGET") + " --via " + ar_script_file;
+ } else {
+ // Strip off any options since the ar commands will be read from file.
+ QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
+ if (ar_cmd.isEmpty())
+ ar_cmd = "ar";
+ createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
+ objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
+ }
} else {
QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty()) {
ld_script_file += "." + var("BUILD_NAME");
}
- createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
- objectsLinkLine = ld_script_file;
+ if (project->isActiveConfig("rvct_linker")) {
+ createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS"));
+ objectsLinkLine = QString::fromLatin1("--via ") + ld_script_file;
+ } else {
+ createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
+ objectsLinkLine = ld_script_file;
+ }
}
Win32MakefileGenerator::writeObjectsPart(t);
}