aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/qtprofilesetup
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-06-08 14:55:29 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-06-08 15:13:47 +0200
commit073fda0ab536b5610ff1b9191db582791552509e (patch)
tree16f0bbacc116e93778e9490ba2c2d9efff738d35 /src/lib/qtprofilesetup
parent9349866b37118db9179d1f0689e872ca1260f040 (diff)
parent5f71b2220f9ff6838799c407972309bff1e8fc96 (diff)
Merge 1.12 into master
Diffstat (limited to 'src/lib/qtprofilesetup')
-rw-r--r--src/lib/qtprofilesetup/templates/qmlcache.qbs26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/lib/qtprofilesetup/templates/qmlcache.qbs b/src/lib/qtprofilesetup/templates/qmlcache.qbs
index 246486c53..9111eb500 100644
--- a/src/lib/qtprofilesetup/templates/qmlcache.qbs
+++ b/src/lib/qtprofilesetup/templates/qmlcache.qbs
@@ -1,14 +1,22 @@
+import qbs.File
import qbs.FileInfo
import qbs.Process
+import qbs.Utilities
Module {
additionalProductTypes: ["qt.qml.qmlc", "qt.qml.jsc"]
- validate: qmlcachegenProbe.found
+ validate: {
+ if (!qmlcachegenProbe.found)
+ throw "qmlcachegen unsupported for this target";
+ }
property string qmlCacheGenPath: FileInfo.joinPaths(Qt.core.binPath, "qmlcachegen")
+ (qbs.hostOS.contains("windows") ? ".exe" : "")
+ property bool supportsAllArchitectures: Utilities.versionCompare(Qt.core.version, "5.11") >= 0
property string installDir
readonly property stringList _targetArgs: {
+ if (supportsAllArchitectures)
+ return [];
function translateArch(arch) {
if (arch === "x86")
return "i386";
@@ -24,15 +32,25 @@ Module {
Depends { name: "Qt.core" }
Probe {
id: qmlcachegenProbe
+
+ property string arch: qbs.architecture
+ property string _qmlCacheGenPath: qmlCacheGenPath
+ property stringList targetArgs: _targetArgs
+ property bool _supportsAllArchitectures: supportsAllArchitectures
+
configure: {
+ if (_supportsAllArchitectures) {
+ found = File.exists(_qmlCacheGenPath);
+ return;
+ }
var process = new Process();
found = false;
try {
- found = process.exec(qmlCacheGenPath,
- _targetArgs.concat("--check-if-supported")) == 0;
+ found = process.exec(_qmlCacheGenPath,
+ targetArgs.concat("--check-if-supported")) == 0;
if (!found) {
var msg = "QML cache generation was requested but is unsupported on "
- + "architecture '" + qbs.architecture + "'.";
+ + "architecture '" + arch + "'.";
console.warn(msg);
}
} finally {