summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2011-08-24 15:56:02 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2011-08-24 16:09:05 +0300
commita9822d39136a3f7912cc68320cfe030d95b4cb4f (patch)
tree41ca2605cd6c6b1c6990a27cebaa4e9cf3cb2105 /qmake
parent8cd5df01478f59fd62786fce032ab7ce04656ca4 (diff)
Improved support for shadow builds in Symbian.
It is now possible to make shadow builds in Symbian. Note that any relative host side paths specified via BLD_INF_RULES, MMP_RULES, or DEPLOYMENT pkg_*rules are NOT automatically converted to point to build directory. Task-number: QTBUG-10432 Rubber-stamped-by: ossi Reviewed-by: TrustMe
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp13
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp6
-rw-r--r--qmake/generators/symbian/symmake.cpp26
-rw-r--r--qmake/generators/symbian/symmake.h1
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp3
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp19
6 files changed, 34 insertions, 34 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 00f6b4ae29..b9de92dc3c 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1769,6 +1769,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
{
QString clean_targets;
const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ QDir outputDir(Option::output_dir);
for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
QString tmp_out = fileFixify(project->values((*it) + ".output").first(),
Option::output_dir, Option::output_dir);
@@ -1960,9 +1961,11 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString cmd;
if (isForSymbianSbsv2()) {
// In sbsv2 the command inputs and outputs need to use absolute paths
- cmd = replaceExtraCompilerVariables(tmp_cmd,
- fileFixify(escapeFilePaths(inputs), FileFixifyAbsolute),
- fileFixify(QStringList(tmp_out), FileFixifyAbsolute));
+ QStringList absoluteInputs;
+ for (int i = 0; i < inputs.size(); ++i)
+ absoluteInputs.append(escapeFilePath(outputDir.absoluteFilePath(inputs.at(i))));
+ cmd = replaceExtraCompilerVariables(tmp_cmd, absoluteInputs,
+ QStringList(outputDir.absoluteFilePath(tmp_out)));
} else {
cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
}
@@ -1996,8 +1999,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if (isForSymbianSbsv2()) {
// In sbsv2 the command inputs and outputs need to use absolute paths
cmd = replaceExtraCompilerVariables(tmp_cmd,
- fileFixify((*input), FileFixifyAbsolute),
- fileFixify(out, FileFixifyAbsolute));
+ outputDir.absoluteFilePath(*input),
+ outputDir.absoluteFilePath(out));
} else {
cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
}
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index d4db4b91b4..c9ffa11fed 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -503,9 +503,11 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile,
twf << wrapperStreamBuffer << endl;
// Wrapped files deployment
- QString currentPath = qmake_getpwd();
+ QString currentPath = Option::output_dir;
+ if (!currentPath.endsWith(QLatin1Char('/')))
+ currentPath += QLatin1Char('/');
QString sisName = QString("%1.sis").arg(fixedTarget);
- twf << "\"" << currentPath << "/" << sisName << "\" - \"!:\\private\\2002CCCE\\import\\" << sisName << "\"" << endl;
+ twf << "\"" << currentPath << sisName << "\" - \"!:\\private\\2002CCCE\\import\\" << sisName << "\"" << endl;
QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath);
bootStrapPath.append("/smartinstaller.sis");
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index bdba329155..694bbfba71 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -126,8 +126,7 @@ QString SymbianMakefileGenerator::absolutizePath(const QString& origPath)
if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive))
resultPath = QDir::fromNativeSeparators(qt_epocRoot()) + resultPath.mid(1);
- QFileInfo fi(fileInfo(resultPath));
-
+ QFileInfo fi(outputDir, resultPath);
// Since origPath can be something given in HEADERS, we need to check if we are dealing
// with a file or a directory. In case the origPath doesn't yet exist, isFile() returns
// false and we default to assuming it is a dir.
@@ -271,6 +270,8 @@ void SymbianMakefileGenerator::init()
MakefileGenerator::init();
SymbianCommonGenerator::init();
+ outputDir = QDir(Option::output_dir);
+
if (0 != project->values("QMAKE_PLATFORM").size())
platform = varGlue("QMAKE_PLATFORM", "", " ", "");
@@ -338,7 +339,6 @@ void SymbianMakefileGenerator::initMmpVariables()
srcpaths << project->values("UNUSED_SOURCES") << project->values("UI_SOURCES_DIR");
srcpaths << project->values("UI_DIR");
- QDir current = QDir::current();
QString absolutizedCurrent = absolutizePath(".");
for (int j = 0; j < srcpaths.size(); ++j) {
@@ -373,12 +373,12 @@ void SymbianMakefileGenerator::initMmpVariables()
QStringList temporary;
for (int i = 0; i < sysincspaths.size(); ++i) {
QString origPath = sysincspaths.at(i);
- QFileInfo origPathInfo(fileInfo(origPath));
+ QFileInfo origPathInfo(outputDir, origPath);
bool bFound = false;
for (int j = 0; j < temporary.size(); ++j) {
QString tmpPath = temporary.at(j);
- QFileInfo tmpPathInfo(fileInfo(tmpPath));
+ QFileInfo tmpPathInfo(outputDir, tmpPath);
if (origPathInfo.absoluteFilePath() == tmpPathInfo.absoluteFilePath()) {
bFound = true;
@@ -515,14 +515,12 @@ void SymbianMakefileGenerator::writeMmpFile(QString &filename, const SymbianLoca
writeMmpFileIncludePart(t);
- QDir current = QDir::current();
-
for (QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
QStringList values = it.value();
QString currentSourcePath = it.key();
if (values.size())
- t << "SOURCEPATH \t" << fixPathForMmp(currentSourcePath, current) << endl;
+ t << "SOURCEPATH \t" << fixPathForMmp(currentSourcePath, Option::output_dir) << endl;
for (int i = 0; i < values.size(); ++i) {
QString sourceFileName = values.at(i);
@@ -709,13 +707,11 @@ void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, const Sy
void SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t)
{
- QDir current = QDir::current();
-
for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
QStringList values = it.value();
for (int i = 0; i < values.size(); ++i) {
QString handledPath = values.at(i);
- t << "SYSTEMINCLUDE\t\t" << fixPathForMmp(handledPath, current) << endl;
+ t << "SYSTEMINCLUDE\t\t" << fixPathForMmp(handledPath, Option::output_dir) << endl;
}
}
@@ -1105,7 +1101,7 @@ void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t)
fromFile = item.endsWith(Option::pro_ext);
fixedItem = item;
}
- QFileInfo fi(fileInfo(fixedItem));
+ QFileInfo fi(outputDir, fixedItem);
if (!fromFile) {
t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl;
} else {
@@ -1118,19 +1114,19 @@ void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t)
}
- generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf
+ generatedFiles << Option::output.fileName(); // bld.inf
generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
QStringList fixedFiles;
QStringList fixedDirs;
foreach(QString item, generatedFiles) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ QString fixedItem = Option::fixPathToTargetOS(outputDir.absoluteFilePath(item));
if (!fixedFiles.contains(fixedItem)) {
fixedFiles << fixedItem;
}
}
foreach(QString item, generatedDirs) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ QString fixedItem = Option::fixPathToTargetOS(outputDir.absoluteFilePath(item));
if (!fixedDirs.contains(fixedItem)) {
fixedDirs << fixedItem;
}
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index 053b2752e4..1dfb1021e1 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -66,6 +66,7 @@ protected:
// (output file) (source , command)
QMap<QString, QStringList> makmakeCommands;
QStringList overriddenMmpKeywords;
+ QDir outputDir;
QString fixPathForMmp(const QString& origPath, const QDir& parentDir);
QString absolutizePath(const QString& origPath);
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index 7863dca731..702635560b 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -70,7 +70,8 @@ SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { }
void SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly)
{
- QFile ft(gnuMakefileName);
+ QString mkFullPath = Option::output_dir + QLatin1Char('/') + gnuMakefileName;
+ QFile ft(mkFullPath);
if (ft.open(QIODevice::WriteOnly)) {
generatedFiles << ft.fileName();
QTextStream t(&ft);
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 78a90247f2..cc32f8daf3 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -624,11 +624,11 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
// are not necessary.
QStringList allPreDeps;
foreach(QString item, project->values("PRE_TARGETDEPS")) {
- allPreDeps.append(fileInfo(item).absoluteFilePath());
+ allPreDeps.append(QDir::cleanPath(outputDir.absoluteFilePath(item)));
}
foreach (QString item, project->values("GENERATED_SOURCES")) {
- allPreDeps.append(fileInfo(item).absoluteFilePath());
+ allPreDeps.append(QDir::cleanPath(outputDir.absoluteFilePath(item)));
}
for (QMap<QString, QStringList>::iterator it = sources.begin(); it != sources.end(); ++it) {
@@ -638,7 +638,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QString sourceFile = currentSourcePath + "/" + values.at(i);
QStringList deps = findDependencies(QDir::toNativeSeparators(sourceFile));
foreach(QString depItem, deps) {
- appendIfnotExist(allPreDeps, fileInfo(depItem).absoluteFilePath());
+ appendIfnotExist(allPreDeps, QDir::cleanPath(outputDir.absoluteFilePath(depItem)));
}
}
}
@@ -649,7 +649,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
foreach(QString item, extraTargets) {
foreach(QString targetItem, project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + item)) {
// Make sure targetpath is absolute
- QString absoluteTarget = fileInfo(targetItem).absoluteFilePath();
+ QString absoluteTarget = QDir::cleanPath(outputDir.absoluteFilePath(targetItem));
if (allPreDeps.contains(absoluteTarget)) {
QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem);
QString commandItem = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" ");
@@ -658,7 +658,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QString absoluteDeps;
foreach (QString depItem, deps) {
if (!depItem.isEmpty()) {
- absoluteDeps.append(fileInfo(depItem).absoluteFilePath());
+ absoluteDeps.append(QDir::cleanPath(outputDir.absoluteFilePath(depItem)));
absoluteDeps.append(" ");
}
}
@@ -723,9 +723,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QFileInfo iconInfo = fileInfo(icon);
- QFileInfo bldinf(project->values("MAKEFILE").first());
- QString iconPath = bldinf.dir().relativeFilePath(iconInfo.path());
-
+ QString iconPath = outputDir.relativeFilePath(iconInfo.absolutePath());
QString iconFile = iconInfo.baseName();
QFileInfo iconTargetInfo = fileInfo(iconTargetFile);
@@ -747,11 +745,10 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
if (!cleanFiles.isEmpty()) {
QStringList absoluteCleanFiles;
foreach (QString cleanFile, cleanFiles) {
- QFileInfo fi(cleanFile);
QString fileName = QLatin1String("\"");
- fileName.append(fi.absoluteFilePath());
+ fileName.append(QDir::cleanPath(outputDir.absoluteFilePath(cleanFile)));
fileName.append(QLatin1String("\""));
- absoluteCleanFiles << fileName;
+ absoluteCleanFiles << fileName;
}
t << "START EXTENSION qt/qmake_clean" << endl;
t << "OPTION CLEAN_FILES " << absoluteCleanFiles.join(" ") << endl;