From 400d9e1d66aacb2760b2190a5f10cfc3d5d359d2 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 26 Apr 2018 17:16:15 +0200 Subject: Make sure probe results are also cached for shadow products Because we don't turn shadow products into actual products in the ProjectResolver, the results of probes run in their context did not end up in the build graph and the configure scripts were therefore needlessly re-executed on the next project resolving. Fix this by storing these probe results along with the project-level ones. Change-Id: I647bbedbbe3fa6f36b536fd1b80fd321894362f8 Reviewed-by: Joerg Bornemann --- src/lib/corelib/language/moduleloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/corelib/language/moduleloader.cpp') diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp index 933c49abc..df47e36ea 100644 --- a/src/lib/corelib/language/moduleloader.cpp +++ b/src/lib/corelib/language/moduleloader.cpp @@ -581,6 +581,8 @@ void ModuleLoader::handleTopLevelProject(ModuleLoaderResult *loadResult, Item *p for (ProductContext * const p : productSorter.sortedProducts()) { try { handleProduct(p); + if (p->name.startsWith(shadowProductPrefix())) + tlp.probes << p->info.probes; } catch (const ErrorInfo &err) { handleProductError(err, p); } @@ -3418,7 +3420,8 @@ void ModuleLoader::resolveProbe(ProductContext *productContext, Item *parent, It const bool condition = m_evaluator->boolValue(probe, StringConstants::conditionProperty()); const QString &sourceCode = configureScript->sourceCode().toString(); ProbeConstPtr resolvedProbe; - if (parent->type() == ItemType::Project) { + if (parent->type() == ItemType::Project + || productContext->name.startsWith(shadowProductPrefix())) { resolvedProbe = findOldProjectProbe(probeId, condition, initialProperties, sourceCode); } else { const QString &uniqueProductName = productContext->uniqueName(); -- cgit v1.2.3