summaryrefslogtreecommitdiff
path: root/share/qbs/modules/cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2022-07-07 11:16:08 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2022-07-07 12:01:21 +0000
commit5d45d6e6a5b4fbb13b9ee3e5949dbfd1978c667a (patch)
tree94a4df37652ac756a592cf148bd99e6b452b5749 /share/qbs/modules/cpp
parent764213fc53fe387dfc66f1b606516c6f9f9df567 (diff)
downloadqbs-5d45d6e6a5b4fbb13b9ee3e5949dbfd1978c667a.tar.gz
Qt support: Fix static builds
- prl files can refer to QT_INSTALL_PLUGINS - object files can appear in QMAKE_PRL_LIBS Change-Id: I2ab707ab3677a1e7be71c93f211677b5df04b23f Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp')
-rw-r--r--share/qbs/modules/cpp/cpp.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/share/qbs/modules/cpp/cpp.js b/share/qbs/modules/cpp/cpp.js
index 846a4cfad..b93d42f21 100644
--- a/share/qbs/modules/cpp/cpp.js
+++ b/share/qbs/modules/cpp/cpp.js
@@ -220,6 +220,7 @@ function precompiledHeaderOutputArtifacts(input, product, lang, generateObjects)
function collectLibraryDependencies(product) {
var seen = {};
+ var seenObjectFiles = [];
var result = [];
function addFilePath(filePath, wholeArchive, productName) {
@@ -248,16 +249,23 @@ function collectLibraryDependencies(product) {
function sanitizedModuleListProperty(obj, moduleName, propertyName) {
return ensureArray(ModUtils.sanitizedModuleProperty(obj, moduleName, propertyName));
}
- function handleExternalLibraries(tag, suffix) {
+ function handleExternalLibraries(tag, libSuffix, objSuffix) {
var externalLibs = sanitizedModuleListProperty(obj, "cpp", tag) || [];
externalLibs.forEach(function(libName) {
- if (!libName.endsWith(suffix) && !libName.startsWith('@'))
- libName += suffix;
+ var isObjectFile = objSuffix && libName.endsWith(objSuffix);
+ if (isObjectFile) {
+ if (seenObjectFiles.contains(libName))
+ return;
+ seenObjectFiles.push(libName);
+ }
+ if (!libName.endsWith(libSuffix) && !isObjectFile && !libName.startsWith('@'))
+ libName += libSuffix;
addFilePath(libName, false);
});
}
handleExternalLibraries("staticLibraries",
- obj.moduleProperty("cpp", "staticLibrarySuffix"));
+ obj.moduleProperty("cpp", "staticLibrarySuffix"),
+ obj.moduleProperty("cpp", "objectSuffix"));
handleExternalLibraries("dynamicLibraries",
obj.moduleProperty("cpp", "dynamicLibraryImportSuffix"));
}