1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
import qbs.base 1.0
import qbs.fileinfo 1.0 as FileInfo
import '../utils.js' as ModUtils
GenericGCC {
condition: qbs.targetOS === "windows" && qbs.toolchain === "mingw"
staticLibraryPrefix: "lib"
dynamicLibraryPrefix: ""
executablePrefix: ""
staticLibrarySuffix: ".a"
dynamicLibrarySuffix: ".dll"
executableSuffix: ".exe"
platformDefines: base.concat(['UNICODE'])
compilerDefines: ['__GNUC__', 'WIN32', '_WIN32']
property string windresName: 'windres'
property string windresPath: { return toolchainPathPrefix + windresName }
setupBuildEnvironment: {
var v = new ModUtils.EnvironmentVariable("PATH", ";", true);
v.prepend(toolchainInstallPath);
v.set();
}
FileTagger {
pattern: "*.rc"
fileTags: ["rc"]
}
Rule {
inputs: ["rc"]
Artifact {
fileName: ".obj/" + product.name + "/" + input.baseDir.replace(':', '') + "/" + input.completeBaseName + "_res.o"
fileTags: ["obj"]
}
prepare: {
var platformDefines = ModUtils.appendAll(input, 'platformDefines');
var defines = ModUtils.appendAll(input, 'defines');
var includePaths = ModUtils.appendAll(input, 'includePaths');
var systemIncludePaths = ModUtils.appendAll(input, 'systemIncludePaths');
var args = [];
var i;
for (i in platformDefines) {
args.push('-D');
args.push(platformDefines[i]);
}
for (i in defines) {
args.push('-D');
args.push(defines[i]);
}
for (i in includePaths) {
args.push('-I');
args.push(includePaths[i]);
}
for (i in systemIncludePaths) {
args.push('-isystem');
args.push(systemIncludePaths[i]);
}
args = args.concat(['-i', input.fileName, '-o', output.fileName]);
var cmd = new Command(product.module.windresPath, args);
cmd.description = 'compiling ' + FileInfo.fileName(input.fileName);
cmd.highlight = 'compiler';
return cmd;
}
}
}
|