look for mkspecs/ even below .qmake.cache/.conf-determined root
otherwise a cache/config in an aggregator project may unduly hide the mkspecs/ of the aggregated project from qmake's view. Change-Id: Idb0b124de071822f8f55463d9f8a4d194ef3130e
This commit is contained in:
parent
1f83f0cf2a
commit
e78c3bb620
@ -1411,20 +1411,25 @@ QMakeProject::read(uchar cmd)
|
|||||||
}
|
}
|
||||||
no_cache:
|
no_cache:
|
||||||
|
|
||||||
if (project_build_root.isEmpty()) {
|
// Look for mkspecs/ in source and build. First to win determines the root.
|
||||||
QDir srcdir(qmake_getpwd());
|
QString sdir = qmake_getpwd();
|
||||||
QDir dstdir(Option::output_dir);
|
QString dir = Option::output_dir;
|
||||||
do {
|
while (dir != project_build_root) {
|
||||||
// Look for mkspecs/ in source and build. First to win determines the root.
|
if ((dir != sdir && QFileInfo(sdir, QLatin1String("mkspecs")).isDir())
|
||||||
if (dstdir.exists("mkspecs") || srcdir.exists("mkspecs")) {
|
|| QFileInfo(dir, QLatin1String("mkspecs")).isDir()) {
|
||||||
project_build_root = dstdir.path();
|
if (dir != sdir)
|
||||||
project_root = srcdir.path();
|
project_root = sdir;
|
||||||
if (project_root == project_build_root)
|
project_build_root = dir;
|
||||||
project_root.clear();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
if (dir == superdir)
|
||||||
} while (!srcdir.isRoot() && srcdir.cdUp()
|
break;
|
||||||
&& dstdir != superdir && !dstdir.isRoot() && dstdir.cdUp());
|
QFileInfo qsdfi(sdir);
|
||||||
|
QFileInfo qdfi(dir);
|
||||||
|
if (qsdfi.isRoot() || qdfi.isRoot())
|
||||||
|
break;
|
||||||
|
sdir = qsdfi.path();
|
||||||
|
dir = qdfi.path();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qmakepath != cached_qmakepath || qmakefeatures != cached_qmakefeatures
|
if (qmakepath != cached_qmakepath || qmakefeatures != cached_qmakefeatures
|
||||||
@ -3317,11 +3322,13 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QHash<QS
|
|||||||
if (cachefile.isEmpty()) {
|
if (cachefile.isEmpty()) {
|
||||||
cachefile = Option::output_dir + QLatin1String("/.qmake.cache");
|
cachefile = Option::output_dir + QLatin1String("/.qmake.cache");
|
||||||
printf("Info: creating cache file %s\n", cachefile.toLatin1().constData());
|
printf("Info: creating cache file %s\n", cachefile.toLatin1().constData());
|
||||||
cached_build_root = Option::output_dir;
|
if (cached_build_root.isEmpty()) {
|
||||||
cached_source_root = values("_PRO_FILE_PWD_", place).first();
|
cached_build_root = Option::output_dir;
|
||||||
if (cached_source_root == cached_build_root)
|
cached_source_root = values("_PRO_FILE_PWD_", place).first();
|
||||||
cached_source_root.clear();
|
if (cached_source_root == cached_build_root)
|
||||||
invalidateFeatureRoots();
|
cached_source_root.clear();
|
||||||
|
invalidateFeatureRoots();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fn = cachefile;
|
fn = cachefile;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user