diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-01-30 10:15:26 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-01-30 16:07:27 +0000 |
commit | 6dde0eb2465f2f312aede85c56756fc7b70de2e8 (patch) | |
tree | b00371d82360b9fe912bad4152712660669bf87c /share | |
parent | 96080962285a0bea25ba750be474e851b811c70b (diff) |
setupRunEnvironment: Do not access properties of undefined values
Task-number: QBS-1290
Change-Id: I47d89ac2bd1cd88a0f38f51c1ce81517a276725b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/modules/cpp/setuprunenv.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/share/qbs/modules/cpp/setuprunenv.js b/share/qbs/modules/cpp/setuprunenv.js index a4be7f988..dcbe5b273 100644 --- a/share/qbs/modules/cpp/setuprunenv.js +++ b/share/qbs/modules/cpp/setuprunenv.js @@ -60,17 +60,18 @@ function gatherPaths(product, libPaths, frameworkPaths) // Heuristic: If any rpaths are set, assume environment paths should not be set up. // Let's not try to be super fancy, evaluating all the rpaths, expanding $ORIGIN, relative paths // and whatnot. - if (product.cpp.useRPaths && product.cpp.rpaths && product.cpp.rpaths.length > 0) + if (!product.qbs.targetOS.contains("windows") && product.cpp && product.cpp.useRPaths + && product.cpp.rpaths && product.cpp.rpaths.length > 0) return; // Gather explicitly given library paths. - if (product.cpp.libraryPaths) + if (product.cpp && product.cpp.libraryPaths) product.cpp.libraryPaths.forEach(function(p) { addExternalLibPath(product, libPaths, p); }); - if (product.cpp.frameworkPaths) + if (product.cpp && product.cpp.frameworkPaths) product.cpp.frameworkPaths.forEach(function(p) { addNewElement(frameworkPaths, p); }); // Extract paths from dynamic libraries, if they are given as file paths. - if (product.cpp.dynamicLibraries) { + if (product.cpp && product.cpp.dynamicLibraries) { product.cpp.dynamicLibraries.forEach(function(dll) { if (FileInfo.isAbsolutePath(dll)) addExternalLibPath(product, libPaths, FileInfo.path(dll)); @@ -115,7 +116,7 @@ function setupRunEnvironment(product, config) var frameworkPaths = []; gatherPaths(product, libPaths, frameworkPaths); - var runPaths = product.cpp.systemRunPaths; + var runPaths = product.cpp ? product.cpp.systemRunPaths : undefined; if (runPaths && runPaths.length > 0) { var filterFunc = function(p) { return !runPaths.contains(p); }; libPaths = libPaths.filter(filterFunc); |