diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-05-03 12:21:53 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-05-03 12:21:53 +0200 |
commit | cdc4d8a0c694598fd4aa6ab484f562d99a094870 (patch) | |
tree | d1703a9fcc195366ebba1a469cce43fb4d400897 /share/qbs/module-providers/Qt | |
parent | 1f5f46e572cf7ffcd2ae4e90024349928719ba35 (diff) | |
parent | 03e717b06ed5c0864618e763f08f91d9fc94b733 (diff) | |
download | qbs-cdc4d8a0c694598fd4aa6ab484f562d99a094870.tar.gz |
Merge 2.0 into master
Change-Id: I521dd5baab4b4374f9221a163ba8e83531edf8bb
Diffstat (limited to 'share/qbs/module-providers/Qt')
-rw-r--r-- | share/qbs/module-providers/Qt/setup-qt.js | 2 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/qml.js | 24 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/qml.qbs | 8 |
3 files changed, 23 insertions, 11 deletions
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index 896b5a457..9fcef7897 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -766,9 +766,11 @@ function doSetupLibraries(modInfo, qtProps, debugBuild, nonExistingPrlFiles, and var parts = extractPaths(line.slice(equalsOffset + 1).trim(), prlFilePath); for (i = 0; i < parts.length; ++i) { var part = parts[i]; + var defaultInstallPrefix = "/Users/qt/work/qt/qtbase/build/target"; part = part.replace("$$[QT_INSTALL_LIBS]", qtProps.libraryPath); part = part.replace("$$[QT_INSTALL_PLUGINS]", qtProps.pluginPath); part = part.replace("$$[QT_INSTALL_PREFIX]", qtProps.installPrefixPath); + part = part.replace(defaultInstallPrefix, qtProps.installPrefixPath); if (part.startsWith("-l")) { libs.push(part.slice(2)); } else if (part.startsWith("-L")) { diff --git a/share/qbs/module-providers/Qt/templates/qml.js b/share/qbs/module-providers/Qt/templates/qml.js index 2a2ff85ab..ad76a0d0f 100644 --- a/share/qbs/module-providers/Qt/templates/qml.js +++ b/share/qbs/module-providers/Qt/templates/qml.js @@ -39,17 +39,32 @@ function getPrlRhs(line) return line.split('=')[1].trim(); } -function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDir, qtPluginDir, - qtDir) +function getLibsForPlugin(pluginData, product) { + var targetOS = product.qbs.targetOS; + var toolchain = product.qbs.toolchain; + var buildVariant = product.Qt.core.qtBuildVariant; + var qtLibDir = product.Qt.core.libPath; + var qtPluginDir = product.Qt.core.pluginPath; + var qtDir = product.Qt.core.installPrefixPath; + var qtQmlPath = product.Qt.qml.qmlPath; + if (!pluginData.path) return ""; var prlFileName = ""; if (!targetOS.contains("windows")) prlFileName += "lib"; prlFileName += pluginData.plugin; - if (buildVariant === "debug" && targetOS.contains("windows")) - prlFileName += "d"; + if (buildVariant === "debug") { + if (targetOS.contains("windows")) { + prlFileName += "d"; + } else if (product.Qt.core.versionMajor >= 6 && + (targetOS.contains("ios") + || targetOS.contains("tvos") + || targetOS.contains("watchos"))) { + prlFileName += "_debug"; + } + } prlFileName += ".prl"; var prlFilePath = FileInfo.joinPaths(pluginData.path, prlFileName); if (!File.exists(prlFilePath)) { @@ -77,6 +92,7 @@ function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDi otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_LIBS\]/g, qtLibDir); otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_PLUGINS\]/g, qtPluginDir); otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_PREFIX\]/g, qtDir); + otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_QML\]/g, qtQmlPath); otherLibs = otherLibs.concat(otherLibsLine.split(' ')); } } diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs index f15705cc5..de1318695 100644 --- a/share/qbs/module-providers/Qt/templates/qml.qbs +++ b/share/qbs/module-providers/Qt/templates/qml.qbs @@ -170,13 +170,7 @@ QtModule { } if (cppFile) cppFile.writeLine("Q_IMPORT_PLUGIN(" + className + ")"); - var libs = Qml.getLibsForPlugin(scannerData[p], - product.Qt.core.qtBuildVariant, - product.qbs.targetOS, - product.qbs.toolchain, - product.Qt.core.libPath, - product.Qt.core.pluginPath, - product.Qt.core.installPrefixPath); + var libs = Qml.getLibsForPlugin(scannerData[p], product); for (var i = 0; i < libs.length; ++i) { var lib = libs[i]; if (!lib.endsWith(product.cpp.objectSuffix) |