aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/setuprunenv.js
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-04-12 13:31:35 +0200
committerThomas Epting <thomas.epting@stryker.com>2018-04-12 12:02:45 +0000
commitfee6a037b7b28afdc2dfd6297eb089d3e5888ff7 (patch)
treebd132da1744ded7be5f221d06a748df09eb480d5 /share/qbs/modules/cpp/setuprunenv.js
parent8da0e97f40abf19a089197c6aec8333a4e92d729 (diff)
setupRunEnv: Visit each product dependency only once
Otherwise products that appear more than once in the dependencies tree (directly and indirectly) will be processed over and over again. Task-number: QTCREATORBUG-20175 Change-Id: I1c67ecc45aa3203c10d35c5822ad8055111331d3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/setuprunenv.js')
-rw-r--r--share/qbs/modules/cpp/setuprunenv.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/share/qbs/modules/cpp/setuprunenv.js b/share/qbs/modules/cpp/setuprunenv.js
index dfc30d20c..5d8bb5248 100644
--- a/share/qbs/modules/cpp/setuprunenv.js
+++ b/share/qbs/modules/cpp/setuprunenv.js
@@ -55,8 +55,12 @@ function addExternalLibPath(product, list, path)
}
}
-function gatherPaths(product, libPaths, frameworkPaths)
+function gatherPaths(product, libPaths, frameworkPaths, seenProducts)
{
+ if (seenProducts.contains(product.name))
+ return;
+ seenProducts.push(product.name);
+
// Gather explicitly given library paths.
if (product.cpp && product.cpp.libraryPaths)
product.cpp.libraryPaths.forEach(function(p) { addExternalLibPath(product, libPaths, p); });
@@ -92,7 +96,7 @@ function gatherPaths(product, libPaths, frameworkPaths)
loadableModuleArtifacts.forEach(addArtifact);
}
if (!dep.hasOwnProperty("present")) // Recurse if the dependency is a product. TODO: Provide non-heuristic way to decide whether dependency is a product.
- gatherPaths(dep, libPaths, frameworkPaths);
+ gatherPaths(dep, libPaths, frameworkPaths, seenProducts);
}
}
@@ -107,7 +111,7 @@ function setupRunEnvironment(product, config)
var libPaths = [];
var frameworkPaths = [];
- gatherPaths(product, libPaths, frameworkPaths);
+ gatherPaths(product, libPaths, frameworkPaths, []);
var runPaths = product.cpp ? product.cpp.systemRunPaths : undefined;
if (runPaths && runPaths.length > 0) {