summaryrefslogtreecommitdiff
path: root/share/qbs/modules/cpp/gcc.js
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-06-15 17:44:58 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-06-20 08:26:08 +0000
commit4764e3eb961013e169c155648f26b0e63eb2b574 (patch)
treea1b761e77188b98eaf8fdba251f18fcc75822696 /share/qbs/modules/cpp/gcc.js
parent5a8e20fe51e95ac5ab97c4c691a3c194383cff55 (diff)
downloadqbs-4764e3eb961013e169c155648f26b0e63eb2b574.tar.gz
Don't link to multiplexed libraries when depending on the aggregate
... library, this can lead to warnings or linker errors. Most easily seen on macOS when multiplexing across multiple architectures, and an app ends up linking against multiple multiplexed variants of a dependent product library. Change-Id: I4ea4b419099a1010f7b8c32ee11079da93f1d236 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/gcc.js')
-rw-r--r--share/qbs/modules/cpp/gcc.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 5ac936eb0..896ae48fa 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -157,6 +157,12 @@ function collectLibraryDependencies(product, isDarwin) {
var nextIsBelowIndirectDynamicLib = isBelowIndirectDynamicLib || isDynamicLibrary;
dep.dependencies.forEach(function(depdep) {
+ // If "dep" is an aggregate product, and "depdep" is one of the multiplexed variants
+ // of the same product, we don't want to depend on the multiplexed variants, because
+ // that could mean linking more than one time against the same library. Instead skip
+ // the multiplexed dependency, and depend only on the aggregate one.
+ if (depdep.name === dep.name)
+ return;
traverse(depdep, nextIsBelowIndirectDynamicLib);
});
if (isStaticLibrary) {