summaryrefslogtreecommitdiff
path: root/share/qbs/module-providers
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/module-providers')
-rw-r--r--share/qbs/module-providers/Qt/provider.qbs2
-rw-r--r--share/qbs/module-providers/Qt/setup-qt.js20
-rw-r--r--share/qbs/module-providers/Qt/templates/QtModule.qbs1
-rw-r--r--share/qbs/module-providers/qbspkgconfig.qbs7
4 files changed, 17 insertions, 13 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 70051172c..9fcef7897 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");
@@ -1581,10 +1579,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
@@ -1657,7 +1655,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);
@@ -1687,8 +1685,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;
@@ -1697,7 +1695,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]);
diff --git a/share/qbs/module-providers/Qt/templates/QtModule.qbs b/share/qbs/module-providers/Qt/templates/QtModule.qbs
index 62e05327b..35421436f 100644
--- a/share/qbs/module-providers/Qt/templates/QtModule.qbs
+++ b/share/qbs/module-providers/Qt/templates/QtModule.qbs
@@ -23,6 +23,7 @@ Module {
// We have to pull in all plugins here, because dependency resolving happens
// before module merging, and we don't know yet if someone set
// Qt.pluginSupport.pluginsByType in the product.
+ // TODO: We might be able to use Qt.pluginSupport.pluginsByType now.
// The real filtering is done later by the plugin module files themselves.
var list = [];
var allPlugins = Qt.plugin_support.allPluginsByType;
diff --git a/share/qbs/module-providers/qbspkgconfig.qbs b/share/qbs/module-providers/qbspkgconfig.qbs
index 92d5fda71..599f76d33 100644
--- a/share/qbs/module-providers/qbspkgconfig.qbs
+++ b/share/qbs/module-providers/qbspkgconfig.qbs
@@ -52,7 +52,12 @@ ModuleProvider {
property stringList extraPaths
property stringList libDirs
property bool staticMode: false
- property path sysroot: qbs.sysroot
+
+ // We take the sysroot default from qbs.sysroot, except for Xcode toolchains, where
+ // the sysroot points into the Xcode installation and does not contain .pc files.
+ property path sysroot: qbs.toolchain && qbs.toolchain.includes("xcode")
+ ? undefined : qbs.sysroot
+
property bool mergeDependencies: true
relativeSearchPaths: {