aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/imports/qbs/UnixUtils
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2014-08-14 17:25:49 -0400
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-08-18 18:43:59 +0200
commit013e2cb762d57fe2a57db390d255f3eea991dc02 (patch)
tree0d645c6685f8d4b4de6f2fea89561cedf4d82738 /share/qbs/imports/qbs/UnixUtils
parenta8e6324de460745ab420f235cc1b5755ae7cc54f (diff)
Fix soname handling on OS X and iOS.
The correct soname (install name) is now generated for frameworks and other bundle product types, and the prefix no longer requires (but still permits) a trailing slash, which is the normal convention. Change-Id: I2de33976352a99eeccc8fa94bf187c36c7968260 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'share/qbs/imports/qbs/UnixUtils')
-rw-r--r--share/qbs/imports/qbs/UnixUtils/unix-utils.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/share/qbs/imports/qbs/UnixUtils/unix-utils.js b/share/qbs/imports/qbs/UnixUtils/unix-utils.js
index 261d1bb5b..9a085b0dc 100644
--- a/share/qbs/imports/qbs/UnixUtils/unix-utils.js
+++ b/share/qbs/imports/qbs/UnixUtils/unix-utils.js
@@ -1,4 +1,16 @@
+var BundleTools = loadExtension("qbs.BundleTools");
+var FileInfo = loadExtension("qbs.FileInfo");
+
function soname(product, outputFileName) {
+ if (product.moduleProperty("qbs", "targetOS").contains("darwin")) {
+ if (BundleTools.isBundleProduct(product))
+ outputFileName = BundleTools.executablePath(product);
+ var prefix = product.moduleProperty("cpp", "installNamePrefix");
+ if (prefix)
+ outputFileName = FileInfo.joinPaths(prefix, outputFileName);
+ return outputFileName;
+ }
+
function majorVersion(version, defaultValue) {
var n = parseInt(version, 10);
return isNaN(n) ? defaultValue : n;