diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-12-03 15:35:05 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-12-04 09:42:52 +0000 |
commit | fa73a6da5a0b48738198ec9762b6950bcb398800 (patch) | |
tree | c6e98228fae902247bf011d1c8ac74424c1cbe04 | |
parent | 491b293b07e59f69f2c8d9721ac6a098844d590d (diff) |
MSVC: Remember only dependencies with libraries
... when collecting link-time dependencies.
This is a hack for the case where an application depends on a static
library, and both depend on a statically built Qt. A Qt plugin does not
declare a library artifact when pulled in by a static library, because
we don't want to link against plugins in that case. As a result, when
the dependency collection runs for the application and finds a Qt
plugin via traversing the static library, it won't see any libraries
there. Before this patch, we'd skip such plugins when encountering
them again as direct dependencies of the application, so they were
missing on the linker command line.
Fixes: QBS-1518
Change-Id: Ia0e5b39e4a2fb80b9fd1384610942ac627978571
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | share/qbs/modules/cpp/msvc.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index 5ede90840..8b7864400 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -322,7 +322,6 @@ function collectLibraryDependencies(product) { function traverse(dep) { if (seen.hasOwnProperty(dep.name)) return; - seen[dep.name] = true; if (dep.parameters.cpp && dep.parameters.cpp.link === false) return; @@ -331,10 +330,12 @@ function collectLibraryDependencies(product) { var dynamicLibraryArtifacts = staticLibraryArtifacts ? null : dep.artifacts["dynamiclibrary_import"]; if (staticLibraryArtifacts) { + seen[dep.name] = true; dep.dependencies.forEach(traverse); addArtifactFilePaths(dep, staticLibraryArtifacts); addExternalLibs(dep); } else if (dynamicLibraryArtifacts) { + seen[dep.name] = true; addArtifactFilePaths(dep, dynamicLibraryArtifacts); } } |