diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2010-02-22 08:44:32 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2010-02-22 08:58:17 (GMT) |
commit | a8af0c1aba81716bd0f609b1d9afe5c10951b303 (patch) | |
tree | 772114d001fc761f84b43a0f4ad19a3889b4e3d0 /qmake/generators/symbian/symmake.cpp | |
parent | 1eb303d4f14dfcffcca3f11cacca7a73f1e53342 (diff) | |
download | Qt-a8af0c1aba81716bd0f609b1d9afe5c10951b303.zip Qt-a8af0c1aba81716bd0f609b1d9afe5c10951b303.tar.gz Qt-a8af0c1aba81716bd0f609b1d9afe5c10951b303.tar.bz2 |
Changed canonical paths to absolute paths in symmake.
Canonical paths were resolving to empty if the paths didn't exist,
which causes problems for clean platform builds. Using absolute paths
instead will generate all required paths.
This will cause a minor inconvenience of warnings about some nonexistent
paths during makefile generation phase of abld builds, but this is
unavoidable. Sbsv2 builds do not display any warnings.
Reviewed-by: Janne Anttila
Diffstat (limited to 'qmake/generators/symbian/symmake.cpp')
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index a712434..217c1c3 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -109,11 +109,13 @@ QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const Q { static QString epocRootStr; if (epocRootStr.isEmpty()) { - QFileInfo efi(epocRoot()); - epocRootStr = efi.canonicalFilePath(); - if (epocRootStr.isEmpty()) { + epocRootStr = epocRoot(); + QFileInfo efi(epocRootStr); + if (!efi.exists() || epocRootStr.isEmpty()) { fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(epocRoot())); epocRootStr = "/"; + } else { + epocRootStr = efi.absoluteFilePath(); } if (!epocRootStr.endsWith("/")) epocRootStr += "/"; @@ -137,16 +139,8 @@ QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const Q return resultPath; } -QString SymbianMakefileGenerator::canonizePath(const QString& origPath) +QString SymbianMakefileGenerator::absolutizePath(const QString& origPath) { - // Since current path gets appended almost always anyway, use it as default - // for nonexisting paths. - static QString defaultPath; - if (defaultPath.isEmpty()) { - QFileInfo fi("."); - defaultPath = fi.canonicalFilePath(); - } - // Prepend epocroot to any paths beginning with "/epoc32/" QString resultPath = QDir::fromNativeSeparators(origPath); if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive)) @@ -154,16 +148,13 @@ QString SymbianMakefileGenerator::canonizePath(const QString& origPath) QFileInfo fi(fileInfo(resultPath)); if (fi.isDir()) { - resultPath = fi.canonicalFilePath(); + resultPath = fi.absoluteFilePath(); } else { - resultPath = fi.canonicalPath(); + resultPath = fi.absolutePath(); } resultPath = QDir::cleanPath(resultPath); - if (resultPath.isEmpty()) - resultPath = defaultPath; - return resultPath; } @@ -695,7 +686,7 @@ void SymbianMakefileGenerator::initMmpVariables() srcpaths << project->values("UI_DIR"); QDir current = QDir::current(); - QString canonizedCurrent = canonizePath("."); + QString absolutizedCurrent = absolutizePath("."); for (int j = 0; j < srcpaths.size(); ++j) { QFileInfo fi(fileInfo(srcpaths.at(j))); @@ -703,10 +694,10 @@ void SymbianMakefileGenerator::initMmpVariables() if (fi.suffix().startsWith("c")) { if (fi.filePath().length() > fi.fileName().length()) { appendIfnotExist(srcincpaths, fi.path()); - sources[canonizePath(fi.path())] += fi.fileName(); + sources[absolutizePath(fi.path())] += fi.fileName(); } else { - sources[canonizedCurrent] += fi.fileName(); - appendIfnotExist(srcincpaths, canonizedCurrent); + sources[absolutizedCurrent] += fi.fileName(); + appendIfnotExist(srcincpaths, absolutizedCurrent); } } } @@ -720,7 +711,7 @@ void SymbianMakefileGenerator::initMmpVariables() incpaths << project->values("UI_DIR"); for (int j = 0; j < incpaths.size(); ++j) { - QString includepath = canonizePath(incpaths.at(j)); + QString includepath = absolutizePath(incpaths.at(j)); appendIfnotExist(sysincspaths, includepath); appendAbldTempDirs(sysincspaths, includepath); } |