aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2023-12-10 14:19:51 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2023-12-12 15:49:23 +0000
commit4a6f033e3b1f4ef9438de5c16d9ca116a23d54f1 (patch)
tree02d095f36efa9ef09cc1b0ec2e0ac32dab733a86 /share
parent54ff1267f6bce0b2e03c884eab2d49b6636da9b8 (diff)
qbspkgconfig: Fix issues with msys/mingw
The pkgconf in MSYS reports relative paths which we treat as relative to the binary. Also, on windows, ';' is used as a separator between paths. Change-Id: I3425ce896e42f87da0cab3f8f06892e28d4e5727 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js b/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js
index a14827353..14cb3f81a 100644
--- a/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js
+++ b/share/qbs/imports/qbs/Probes/qbs-pkg-config-probe.js
@@ -104,15 +104,20 @@ function configure(
];
}
if (!options.libDirs) {
- // if we have pkg-config installed, let's ask it for its search paths (since
+ // if we have pkg-config/pkgconf installed, let's ask it for its search paths (since
// built-in search paths can differ between platforms)
var executable = executableFilePath ? executableFilePath : getPkgConfigExecutable();
if (executable) {
var p = new Process()
if (p.exec(executable, ['pkg-config', '--variable=pc_path']) === 0) {
var stdout = p.readStdOut().trim();
- // TODO: pathListSeparator? depends on what pkg-config prints on Windows
- options.libDirs = stdout ? stdout.split(':'): [];
+ options.libDirs = stdout ? stdout.split(FileInfo.pathListSeparator()): [];
+ var installDir = FileInfo.path(executable);
+ options.libDirs = options.libDirs.map(function(path){
+ if (FileInfo.isAbsolutePath(path))
+ return path;
+ return FileInfo.cleanPath(FileInfo.joinPaths(installDir, path));
+ });
}
}
}