aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-03-12 11:50:47 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2019-03-12 12:14:53 +0000
commit27d9bc85aa5eb2aa717fdc909cb2104cad0d3334 (patch)
tree8c101a755380c09f54f14ba18b39f86ffa54c18a /share
parentd596d72ae8fdb1e936eafadd94004cdea3b4ab64 (diff)
PkgConfigProbe: Check for package version in an extra call
The --*-version arguments cannot be mixed with --cflags and --libs. Change-Id: I6326fd34f4698cb91cdaa592d7843bd2fdeaa7cf Fixes: QBS-1430 Reviewed-by: Kai Dohmen <psykai1993@googlemail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs19
1 files changed, 12 insertions, 7 deletions
diff --git a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
index fe665b227..b295c7441 100644
--- a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
@@ -61,13 +61,6 @@ Probe {
throw 'PkgConfigProbe.packageNames must be specified.';
var p = new Process();
try {
- var args = packageNames;
- if (minVersion !== undefined)
- args.unshift("--atleast-version=" + minVersion);
- if (exactVersion !== undefined)
- args.unshift("--exact-version=" + exactVersion);
- if (maxVersion !== undefined)
- args.unshift("--max-version=" + maxVersion);
var libDirsToSet = libDirs;
if (sysroot) {
p.setEnv("PKG_CONFIG_SYSROOT_DIR", sysroot);
@@ -80,6 +73,18 @@ Probe {
}
if (libDirsToSet)
p.setEnv("PKG_CONFIG_LIBDIR", libDirsToSet.join(pathListSeparator));
+ var versionArgs = [];
+ if (minVersion !== undefined)
+ versionArgs.push("--atleast-version=" + minVersion);
+ if (exactVersion !== undefined)
+ versionArgs.push("--exact-version=" + exactVersion);
+ if (maxVersion !== undefined)
+ versionArgs.push("--max-version=" + maxVersion);
+ if (versionArgs.length !== 0
+ && p.exec(executable, versionArgs.concat(packageNames)) !== 0) {
+ return;
+ }
+ var args = packageNames;
if (p.exec(executable, args.concat([ '--cflags' ])) === 0) {
cflags = p.readStdOut().trim();
cflags = cflags ? cflags.split(/\s/) : [];