diff options
author | Jörg Bornemann <joerg.bornemann@qt.io> | 2019-07-04 13:30:23 +0000 |
---|---|---|
committer | Jörg Bornemann <joerg.bornemann@qt.io> | 2019-07-04 19:44:52 +0000 |
commit | adaa997ce654bc7d488e887c9b7a971fc037a775 (patch) | |
tree | 664a2b65ca4f26a8e8e7df5d152c9836047c0a5a /qmake | |
parent | 11d9af5d957ac391a0c6cfdea4819df44b2b1560 (diff) |
Revert "Fix determination of source and build roots"
This reverts commit 224a60989ed95e8b91ac88a12666af6e5a66e619.
Turns out that we cannot just untangle the determination of
source root and build root, because this breaks the assumption
that every .qmake.conf results in a separate .qmake.cache in the
build tree. QTBUG-76140 must be fixed differently.
Fixes: QTBUG-76907
Change-Id: I5c0a3719d5e00a0f1cacad51651b47c1f284d22d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 09c1f80222..432339d48e 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1128,48 +1128,35 @@ bool QMakeEvaluator::prepareProject(const QString &inDir) } superdir = qdfi.path(); } + QString sdir = inDir; QString dir = m_outputDir; forever { + conffile = sdir + QLatin1String("/.qmake.conf"); + if (!m_vfs->exists(conffile, flags)) + conffile.clear(); cachefile = dir + QLatin1String("/.qmake.cache"); if (!m_vfs->exists(cachefile, flags)) cachefile.clear(); - if (!cachefile.isEmpty()) { + if (!conffile.isEmpty() || !cachefile.isEmpty()) { + if (dir != sdir) + m_sourceRoot = sdir; m_buildRoot = dir; break; } if (dir == superdir) goto no_cache; - QFileInfo qdfi(dir); - if (qdfi.isRoot()) { - cachefile.clear(); - break; - } - dir = qdfi.path(); - } - QString sdir = inDir; - forever { - conffile = sdir + QLatin1String("/.qmake.conf"); - if (!m_vfs->exists(conffile, flags)) - conffile.clear(); - if (!conffile.isEmpty()) { - if (sdir != m_buildRoot) - m_sourceRoot = sdir; - break; - } QFileInfo qsdfi(sdir); - if (qsdfi.isRoot()) { - conffile.clear(); - break; - } + QFileInfo qdfi(dir); + if (qsdfi.isRoot() || qdfi.isRoot()) + goto no_cache; sdir = qsdfi.path(); + dir = qdfi.path(); } } else { m_buildRoot = QFileInfo(cachefile).path(); } - if (!conffile.isEmpty()) - m_conffile = QDir::cleanPath(conffile); - if (!cachefile.isEmpty()) - m_cachefile = QDir::cleanPath(cachefile); + m_conffile = QDir::cleanPath(conffile); + m_cachefile = QDir::cleanPath(cachefile); } no_cache: |