aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-07-21 14:55:06 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-07-21 19:54:17 +0000
commit8e7dee1c9a7a0dc29eec7c5339cb77382dccb58f (patch)
treedad606ae8755749d46d79e105b36eb6892c2a5c3
parent35837e5b25d98a417e5724ae5b41939eb2cc4854 (diff)
Loader: Fix product id scope again
There's the product's scope and the scope for the product's child items, which are not related. The ids need to be in both. Amends 1410d1f12fb99fb8ab82fe3c2969bc18445a1165. Change-Id: I08b5ccc803818bd6c519ea4b5946dbbac740bdad Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--src/lib/corelib/loader/productscollector.cpp6
-rw-r--r--tests/auto/language/testdata/probes-and-multiplexing.qbs4
-rw-r--r--tests/auto/language/tst_language.cpp8
3 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/corelib/loader/productscollector.cpp b/src/lib/corelib/loader/productscollector.cpp
index 340398016..1c93f175f 100644
--- a/src/lib/corelib/loader/productscollector.cpp
+++ b/src/lib/corelib/loader/productscollector.cpp
@@ -351,11 +351,13 @@ void ProductsCollector::Private::prepareProduct(ProjectContext &projectContext,
for (Item * const child : productItem->children()) {
if (child->id().isEmpty())
continue;
- if (productItem->scope() == productContext.project->scope) {
+ if (productItem->scope() == productContext.project->scope) {
productItem->setScope(Item::create(productItem->pool(), ItemType::Scope));
productItem->scope()->setScope(productContext.project->scope);
}
- productItem->scope()->setProperty(child->id(), ItemValue::create(child));
+ const ItemValuePtr childValue = ItemValue::create(child);
+ productItem->scope()->setProperty(child->id(), childValue);
+ productContext.scope->setProperty(child->id(), childValue);
}
const bool hasExportItems = mergeExportItems(productContext);
diff --git a/tests/auto/language/testdata/probes-and-multiplexing.qbs b/tests/auto/language/testdata/probes-and-multiplexing.qbs
index 0bc835b2d..38de08aee 100644
--- a/tests/auto/language/testdata/probes-and-multiplexing.qbs
+++ b/tests/auto/language/testdata/probes-and-multiplexing.qbs
@@ -8,4 +8,8 @@ Product {
property string archOut
configure: { archOut = archIn; }
}
+ Group {
+ name: "theGroup"
+ qbs.sysroot: "/" + theProbe.archOut
+ }
}
diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp
index c74a6734f..554550299 100644
--- a/tests/auto/language/tst_language.cpp
+++ b/tests/auto/language/tst_language.cpp
@@ -2415,6 +2415,14 @@ void TestLanguage::probesAndMultiplexing()
.toString();
QVERIFY2(architectures.removeOne(arch), qPrintable(arch));
QCOMPARE(product->productProperties.value("archFromProbe").toString(), arch);
+ bool foundGroup = false;
+ for (const GroupPtr &group : product->groups) {
+ if (group->name == "theGroup") {
+ foundGroup = true;
+ QCOMPARE(group->properties->moduleProperty("qbs", "sysroot"), "/" + arch);
+ }
+ }
+ QVERIFY(foundGroup);
}
} catch (const ErrorInfo &e) {
exceptionCaught = true;