diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2017-04-03 15:44:36 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2017-04-11 05:37:52 +0000 |
commit | 2019e78d87e0bff1118fe3b1144985c3bf67c2b4 (patch) | |
tree | b8ce7575578c1aebb693727fbecc3888d8fe9714 /qmake | |
parent | 46c66bce5de04396292600b0c2c87c2468a02102 (diff) |
qmake: Do not mix canonical and non canonical paths
When having Qt sources in a symbolic link "shadowed" did not work
because _PRO_FILE_PWD_ used canonical path, while source_root did not.
Due to this mix it was possible that shadowedPath did not find any
"common denominator" and always returned and empty string. The first
place where things broke was while running config.tests.
Task-number: QTBUG-59319
Change-Id: If73ecbc58290ee9113f887a73c312ebfb5e20a33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/option.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qmake/option.cpp b/qmake/option.cpp index 52f9cb8a0e..4da2a1ae2c 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -462,7 +462,9 @@ Option::init(int argc, char **argv) void Option::prepareProject(const QString &pfile) { - QString srcpath = QDir::cleanPath(QFileInfo(pfile).absolutePath()); + // Canonicalize only the directory, otherwise things will go haywire + // if the file itself is a symbolic link. + const QString srcpath = QFileInfo(QFileInfo(pfile).absolutePath()).canonicalFilePath(); globals->setDirectories(srcpath, output_dir); } |