summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2023-04-21 20:37:34 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2023-05-01 10:20:03 +0000
commitde9bbe60e78960cf9bb086725ebb2df0156b6e54 (patch)
tree188bedf2ffda998a68596a71d7f885f14f730892
parent53a476fbcd9601f5cab5329c385f6c39a82ff038 (diff)
downloadqbs-de9bbe60e78960cf9bb086725ebb2df0156b6e54.tar.gz
Cleanup unneded usages of qbs module in Qt provider
Change-Id: Ibc8ee42bda7273d418c3cbaa69eecbc61674e6cd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--share/qbs/module-providers/Qt/provider.qbs2
-rw-r--r--share/qbs/module-providers/Qt/setup-qt.js20
2 files changed, 10 insertions, 12 deletions
diff --git a/share/qbs/module-providers/Qt/provider.qbs b/share/qbs/module-providers/Qt/provider.qbs
index 33083c51d..be026b1e0 100644
--- a/share/qbs/module-providers/Qt/provider.qbs
+++ b/share/qbs/module-providers/Qt/provider.qbs
@@ -2,5 +2,5 @@ import "setup-qt.js" as SetupQt
ModuleProvider {
property stringList qmakeFilePaths
- relativeSearchPaths: SetupQt.doSetup(qmakeFilePaths, outputBaseDir, path, qbs)
+ relativeSearchPaths: SetupQt.doSetup(qmakeFilePaths, outputBaseDir, path)
}
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js
index 08fc8b999..896b5a457 100644
--- a/share/qbs/module-providers/Qt/setup-qt.js
+++ b/share/qbs/module-providers/Qt/setup-qt.js
@@ -48,9 +48,8 @@ var Utilities = require("qbs.Utilities");
function splitNonEmpty(s, c) { return s.split(c).filter(function(e) { return e; }); }
function toNative(p) { return FileInfo.toNativeSeparators(p); }
-function exeSuffix(qbs) { return FileInfo.executableSuffix(); }
-function getQmakeFilePaths(qmakeFilePaths, qbs) {
+function getQmakeFilePaths(qmakeFilePaths) {
if (qmakeFilePaths && qmakeFilePaths.length > 0)
return qmakeFilePaths;
console.info("Detecting Qt installations...");
@@ -58,9 +57,8 @@ function getQmakeFilePaths(qmakeFilePaths, qbs) {
var pathValue = Environment.getEnv("PATH");
if (pathValue) {
var dirs = splitNonEmpty(pathValue, FileInfo.pathListSeparator());
- var suffix = exeSuffix(qbs);
for (var i = 0; i < dirs.length; ++i) {
- var candidate = FileInfo.joinPaths(dirs[i], "qmake" + suffix);
+ var candidate = FileInfo.joinPaths(dirs[i], "qmake" + FileInfo.executableSuffix());
var canonicalCandidate = FileInfo.canonicalPath(candidate);
if (!canonicalCandidate || !File.exists(canonicalCandidate))
continue;
@@ -248,7 +246,7 @@ function abiToArchitecture(abi) {
}
}
-function getQtProperties(qmakeFilePath, qbs) {
+function getQtProperties(qmakeFilePath) {
var queryResult = queryQmake(qmakeFilePath);
var qtProps = {};
qtProps.installPrefixPath = pathQueryValue(queryResult, "QT_INSTALL_PREFIX");
@@ -1579,10 +1577,10 @@ function copyTemplateFile(fileName, targetDirectory, qtProps, abi, location, all
targetFile.close();
}
-function setupOneQt(qmakeFilePath, outputBaseDir, uniquify, location, qbs) {
+function setupOneQt(qmakeFilePath, outputBaseDir, uniquify, location) {
if (!File.exists(qmakeFilePath))
throw "The specified qmake file path '" + toNative(qmakeFilePath) + "' does not exist.";
- var qtProps = getQtProperties(qmakeFilePath, qbs);
+ var qtProps = getQtProperties(qmakeFilePath);
var androidAbis = [];
if (qtProps.androidAbis !== undefined)
// Multiple androidAbis detected: Qt >= 5.14
@@ -1655,7 +1653,7 @@ function setupOneQt(qmakeFilePath, outputBaseDir, uniquify, location, qbs) {
allFiles);
var qmlcacheStr = "qmlcache";
if (File.exists(FileInfo.joinPaths(qtProps.qmlLibExecPath,
- "qmlcachegen" + exeSuffix(qbs)))) {
+ "qmlcachegen" + FileInfo.executableSuffix()))) {
copyTemplateFile(qmlcacheStr + ".qbs",
FileInfo.joinPaths(qbsQtModuleBaseDir, qmlcacheStr), qtProps,
androidAbis[a], location, allFiles);
@@ -1685,8 +1683,8 @@ function setupOneQt(qmakeFilePath, outputBaseDir, uniquify, location, qbs) {
return relativeSearchPaths;
}
-function doSetup(qmakeFilePaths, outputBaseDir, location, qbs) {
- qmakeFilePaths = getQmakeFilePaths(qmakeFilePaths, qbs);
+function doSetup(qmakeFilePaths, outputBaseDir, location) {
+ qmakeFilePaths = getQmakeFilePaths(qmakeFilePaths);
if (!qmakeFilePaths || qmakeFilePaths.length === 0)
return [];
var uniquifySearchPath = qmakeFilePaths.length > 1;
@@ -1695,7 +1693,7 @@ function doSetup(qmakeFilePaths, outputBaseDir, location, qbs) {
try {
console.info("Setting up Qt at '" + toNative(qmakeFilePaths[i]) + "'...");
var searchPaths = setupOneQt(qmakeFilePaths[i], outputBaseDir, uniquifySearchPath,
- location, qbs);
+ location);
if (searchPaths.length > 0) {
for (var j = 0; j < searchPaths.length; ++j )
allSearchPaths.push(searchPaths[j]);