diff options
Diffstat (limited to 'share/qbs/modules/cpp/setuprunenv.js')
-rw-r--r-- | share/qbs/modules/cpp/setuprunenv.js | 10 |
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) { |