aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/module-providers/Qt
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/module-providers/Qt')
-rw-r--r--share/qbs/module-providers/Qt/setup-qt.js7
-rw-r--r--share/qbs/module-providers/Qt/templates/core.qbs1
-rw-r--r--share/qbs/module-providers/Qt/templates/qml.js9
-rw-r--r--share/qbs/module-providers/Qt/templates/qml.qbs15
4 files changed, 23 insertions, 9 deletions
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js
index 6dd42312c..72b21c395 100644
--- a/share/qbs/module-providers/Qt/setup-qt.js
+++ b/share/qbs/module-providers/Qt/setup-qt.js
@@ -792,12 +792,12 @@ function doSetupLibraries(modInfo, qtProps, debugBuild, nonExistingPrlFiles, and
} catch (e) {
// qt_ext_lib_extX.pri (usually) don't have a corresponding prl file.
// So the pri file variable QMAKE_LIBS_LIBX points to the library
- if (modInfo.isExternal ) {
+ if (modInfo.isExternal) {
libFilePath = debugBuild ? modInfo.staticLibrariesDebug[0] :
modInfo.staticLibrariesRelease[0];
- } else {
- libFilePath = guessLibraryFilePath(prlFilePath, libDir, qtProps);
}
+ if (!libFilePath || !File.exists(libFilePath))
+ libFilePath = guessLibraryFilePath(prlFilePath, libDir, qtProps);
if (nonExistingPrlFiles.contains(prlFilePath))
return;
nonExistingPrlFiles.push(prlFilePath);
@@ -1425,6 +1425,7 @@ function replaceSpecialValues(content, module, qtProps, abi) {
qtConfig: ModUtils.toJSLiteral(qtProps.qtConfigItems),
binPath: ModUtils.toJSLiteral(qtProps.binaryPath),
installPath: ModUtils.toJSLiteral(qtProps.installPath),
+ installPrefixPath: ModUtils.toJSLiteral(qtProps.installPrefixPath),
libPath: ModUtils.toJSLiteral(qtProps.libraryPath),
libExecPath: ModUtils.toJSLiteral(qtProps.libExecPath),
qmlLibExecPath: ModUtils.toJSLiteral(qtProps.qmlLibExecPath),
diff --git a/share/qbs/module-providers/Qt/templates/core.qbs b/share/qbs/module-providers/Qt/templates/core.qbs
index 18ad5a2ab..fd81930ba 100644
--- a/share/qbs/module-providers/Qt/templates/core.qbs
+++ b/share/qbs/module-providers/Qt/templates/core.qbs
@@ -43,6 +43,7 @@ Module {
property path installPath: @installPath@
property path incPath: @incPath@
property path libPath: @libPath@
+ property path installPrefixPath: @installPrefixPath@
property path libExecPath: @libExecPath@
property path qmlLibExecPath: @qmlLibExecPath@
property path pluginPath: @pluginPath@
diff --git a/share/qbs/module-providers/Qt/templates/qml.js b/share/qbs/module-providers/Qt/templates/qml.js
index ea8293f2d..36f60f8a3 100644
--- a/share/qbs/module-providers/Qt/templates/qml.js
+++ b/share/qbs/module-providers/Qt/templates/qml.js
@@ -39,7 +39,7 @@ function getPrlRhs(line)
return line.split('=')[1].trim();
}
-function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDir)
+function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDir, qtDir)
{
if (!pluginData.path)
return "";
@@ -59,7 +59,7 @@ function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDi
var prlFile = new TextFile(prlFilePath, TextFile.ReadOnly);
try {
var pluginLib;
- var otherLibs = "";
+ var otherLibs = [];
var line;
while (!prlFile.atEof()) {
line = prlFile.readLine().trim();
@@ -74,12 +74,13 @@ function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDi
otherLibsLine = otherLibsLine.replace(/-l([^ ]+)/g, "$1" + ".lib");
}
otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_LIBS\]/g, qtLibDir);
- otherLibs += otherLibsLine + '\n';
+ otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_PREFIX\]/g, qtDir);
+ otherLibs = otherLibs.concat(otherLibsLine.split(' '));
}
}
if (!pluginLib)
throw "Malformed prl file '" + prlFilePath + "'.";
- return pluginLib + ' ' + otherLibs;
+ return [pluginLib].concat(otherLibs);
} finally {
prlFile.close();
}
diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs
index 23cb60426..747558f10 100644
--- a/share/qbs/module-providers/Qt/templates/qml.qbs
+++ b/share/qbs/module-providers/Qt/templates/qml.qbs
@@ -1,3 +1,4 @@
+import qbs.FileInfo
import qbs.Host
import qbs.TextFile
import '../QtModule.qbs' as QtModule
@@ -156,6 +157,7 @@ QtModule {
if (cppFile)
cppFile.writeLine("#include <QtPlugin>");
var plugins = { };
+ var libsWithUniqueObjects = [];
for (var p in scannerData) {
var plugin = scannerData[p].plugin;
if (!plugin || plugins[plugin])
@@ -172,9 +174,18 @@ QtModule {
product.Qt.core.qtBuildVariant,
product.qbs.targetOS,
product.qbs.toolchain,
- product.Qt.core.libPath);
- listFile.write(libs + ' ');
+ product.Qt.core.libPath,
+ product.Qt.core.installPrefixPath);
+ for (var i = 0; i < libs.length; ++i) {
+ var lib = libs[i];
+ if (!lib.endsWith(product.cpp.objectSuffix)
+ || (!libsWithUniqueObjects.contains(lib)
+ && !product.cpp.staticLibraries.contains(FileInfo.cleanPath(lib)))) {
+ libsWithUniqueObjects.push(lib);
+ }
+ }
}
+ listFile.write(libsWithUniqueObjects.join("\n"));
} finally {
if (cppFile)
cppFile.close();