aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-12-07 14:36:48 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2017-12-08 10:32:47 +0000
commit955bfa49711ab3b0d13b081a2d016c3dcf9ce218 (patch)
treec01c772b860664730b16078b43651d8738533aef /share
parent2c227d41b0bfa42ad5b8d4140af3302515bd8deb (diff)
setupRunEnvironment: Remove redundant code
The functionality was already present in ModUtils. Change-Id: I36ee3b6eee0817448db1ef7e95eb6f72a5ac99c9 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/setuprunenv.js17
1 files changed, 4 insertions, 13 deletions
diff --git a/share/qbs/modules/cpp/setuprunenv.js b/share/qbs/modules/cpp/setuprunenv.js
index 62c4902b9..8acacdd30 100644
--- a/share/qbs/modules/cpp/setuprunenv.js
+++ b/share/qbs/modules/cpp/setuprunenv.js
@@ -37,20 +37,11 @@ function addNewElement(list, elem)
list.push(elem);
}
-function artifactDir(artifact, product)
+function artifactDir(artifact)
{
if (!artifact.qbs.install)
return FileInfo.path(artifact.filePath);
- var installBaseDir = FileInfo.joinPaths(artifact.qbs.installRoot, artifact.qbs.installPrefix,
- artifact.qbs.installDir);
- var installSourceBase = artifact.qbs.installSourceBase;
- if (!installSourceBase)
- return installBaseDir;
- if (!FileInfo.isAbsolutePath(installSourceBase))
- installSourceBase = FileInfo.joinPaths(product.sourceDirectory, installSourceBase);
- var relativeInstallDir = FileInfo.path(FileInfo.relativePath(installSourceBase,
- artifact.filePath));
- return FileInfo.joinPaths(installBaseDir, relativeInstallDir);
+ return FileInfo.path(ModUtils.artifactInstalledFilePath(artifact));
}
function gatherPaths(product, libPaths, frameworkPaths)
@@ -81,12 +72,12 @@ function gatherPaths(product, libPaths, frameworkPaths)
var dllSymlinkArtifacts = dep.artifacts["bundle.symlink.executable"];
if (dllSymlinkArtifacts) {
var addArtifact = function(artifact) {
- addNewElement(frameworkPaths, FileInfo.path(artifactDir(artifact, dep)));
+ addNewElement(frameworkPaths, FileInfo.path(artifactDir(artifact)));
};
dllSymlinkArtifacts.forEach(addArtifact); // TODO: Will also catch applications. Can we prevent that?
} else {
addArtifact = function(artifact) {
- addNewElement(libPaths, artifactDir(artifact, dep));
+ addNewElement(libPaths, artifactDir(artifact));
};
var dllArtifacts = dep.artifacts["dynamiclibrary"];
if (dllArtifacts)