aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2014-08-22 06:32:43 -0400
committerChristian Kandeler <christian.kandeler@digia.com>2014-08-28 15:21:53 +0200
commit58f3c809ec0c7e9a9ddc87a6baf926738513bbd0 (patch)
tree8fefe0a0663445b6b02cde68819d40605f18dc8f /share
parent0182ef8978c2a5dd3845630f6213e76cca3fc0d9 (diff)
Fix run environment setup.
Now Darwin platforms get the same DYLD_* environment variables set as Xcode (plus Qt) so applications can be developed/tested without embedding bundles. This brings equivalent behavior to what already exists on Windows. This also fixes a regression introduced in 5877328c4dacb1283408083cb3538ea5bc46eae5 with the Node.js module, causing the working directory to be inappropriately changed by the run command. Change-Id: Ic2904f105378eb61d9236367329a2f9c8771a7d3 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/DarwinGCC.qbs23
-rw-r--r--share/qbs/modules/nodejs/NodeJS.qbs4
2 files changed, 24 insertions, 3 deletions
diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs
index 104d4f007..1b12fd069 100644
--- a/share/qbs/modules/cpp/DarwinGCC.qbs
+++ b/share/qbs/modules/cpp/DarwinGCC.qbs
@@ -41,6 +41,29 @@ UnixGCC {
}
}
+ setupRunEnvironment: {
+ var env;
+ var installRoot = getEnv("QBS_INSTALL_ROOT");
+
+ env = new ModUtils.EnvironmentVariable("DYLD_FRAMEWORK_PATH", qbs.pathListSeparator);
+ env.append(FileInfo.joinPaths(installRoot, qbs.installPrefix, "Library", "Frameworks"));
+ env.append(FileInfo.joinPaths(installRoot, qbs.installPrefix, "lib"));
+ env.append(FileInfo.joinPaths(installRoot, qbs.installPrefix));
+ env.set();
+
+ env = new ModUtils.EnvironmentVariable("DYLD_LIBRARY_PATH", qbs.pathListSeparator);
+ env.append(FileInfo.joinPaths(installRoot, qbs.installPrefix, "lib"));
+ env.append(FileInfo.joinPaths(installRoot, qbs.installPrefix, "Library", "Frameworks"));
+ env.append(FileInfo.joinPaths(installRoot, qbs.installPrefix));
+ env.set();
+
+ if (qbs.sysroot) {
+ env = new ModUtils.EnvironmentVariable("DYLD_ROOT_PATH", qbs.pathListSeparator);
+ env.append(qbs.sysroot);
+ env.set();
+ }
+ }
+
// private properties
readonly property var buildEnv: {
var env = {
diff --git a/share/qbs/modules/nodejs/NodeJS.qbs b/share/qbs/modules/nodejs/NodeJS.qbs
index a18d5d98b..9677cd000 100644
--- a/share/qbs/modules/nodejs/NodeJS.qbs
+++ b/share/qbs/modules/nodejs/NodeJS.qbs
@@ -16,9 +16,7 @@ Module {
setupRunEnvironment: {
var v = new ModUtils.EnvironmentVariable("NODE_PATH", qbs.pathListSeparator, qbs.hostOS.contains("windows"));
- // can't use product.buildDirectory here, but RunEnvironment always sets the working
- // directory to the directory containing the target file so we can exploit this for now
- v.prepend(".");
+ v.prepend(FileInfo.path(getEnv("QBS_RUN_FILE_PATH")));
v.set();
}