aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/wix/WiXModule.qbs
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2016-12-08 16:16:11 -0800
committerJake Petroules <jake.petroules@qt.io>2016-12-09 19:17:20 +0000
commitbabbf2156579e6e0bbdac973aa5fc8c30d00b806 (patch)
tree6b928ea94a30ddd059e29f3eb4bf3c43725cec4f /share/qbs/modules/wix/WiXModule.qbs
parent64e336b7af5b863de7e8108448f9103706786714 (diff)
Fix some issues in the WiX module causing the autotest to fail
This allows qbs.architecture to be undefined for WiX, in which case the WiX default architecture of x86 will be used. The autotest would fail if there was no architecture set in the profile (which is allowed). This also corrects the registry key name for finding WiX, leading to incorrect autotest failures if WiX tools were in not in the PATH or WiX properties were not set in a profile. Lastly, this fixes a wrong concatenation of product.buildDirectory and improves the output and error reporting for the autotest. Change-Id: I227924b681131c13fcb09d2d5010b372ff44b241 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/wix/WiXModule.qbs')
-rw-r--r--share/qbs/modules/wix/WiXModule.qbs30
1 files changed, 20 insertions, 10 deletions
diff --git a/share/qbs/modules/wix/WiXModule.qbs b/share/qbs/modules/wix/WiXModule.qbs
index 1ef816f87..e605b5e21 100644
--- a/share/qbs/modules/wix/WiXModule.qbs
+++ b/share/qbs/modules/wix/WiXModule.qbs
@@ -208,14 +208,16 @@ Module {
}
var arch = product.moduleProperty("qbs", "architecture");
- if (!["x86", "x86_64", "ia64", "arm"].contains(arch)) {
- // http://wixtoolset.org/documentation/manual/v3/xsd/wix/package.html
- throw("WiX: unsupported architecture '" + arch + "'");
- }
- // QBS uses "x86_64", Microsoft uses "x64"
- if (arch === "x86_64") {
+ // http://wixtoolset.org/documentation/manual/v3/xsd/wix/package.html
+ switch (arch) {
+ case "x86_64":
arch = "x64";
+ break;
+ case "armv7":
+ case "armv7a":
+ arch = "arm";
+ break;
}
// Visual Studio defines these variables along with various solution and project names and paths;
@@ -245,10 +247,10 @@ Module {
throw("WiX: Unsupported product type '" + product.type + "'");
}
- var builtBinaryFilePath = FileInfo.joinPaths(product.buildDirectory, product.destinationDirectory, product.targetName + productTargetExt);
+ var builtBinaryFilePath = FileInfo.joinPaths(product.destinationDirectory, product.targetName + productTargetExt);
args.push("-dOutDir=" + FileInfo.toWindowsSeparators(FileInfo.path(builtBinaryFilePath))); // in VS, relative to the project file by default
- args.push("-dPlatform=" + arch);
+ args.push("-dPlatform=" + (arch || "x86"));
args.push("-dProjectName=" + project.name);
@@ -301,8 +303,11 @@ Module {
args.push("-out");
args.push(FileInfo.toWindowsSeparators(output.filePath));
- args.push("-arch");
- args.push(arch);
+
+ if (arch) {
+ args.push("-arch");
+ args.push(arch);
+ }
var extensions = ModUtils.moduleProperty(input, "extensions");
for (i in extensions) {
@@ -316,6 +321,11 @@ Module {
cmd.description = "compiling " + input.fileName;
cmd.highlight = "compiler";
cmd.workingDirectory = FileInfo.path(output.filePath);
+ // candle.exe outputs the file name. We filter that out.
+ cmd.inputFileName = input.fileName;
+ cmd.stdoutFilterFunction = function(output) {
+ return output.split(inputFileName + "\r\n").join("");
+ };
return cmd;
}
}