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
71
72
73
74
75
76
77
78
79
|
import qbs 1.0
import qbs.FileInfo
import qbs.ModUtils
import "windows.js" as Windows
GenericGCC {
condition: qbs.targetOS.contains("windows") && qbs.toolchain.contains("mingw")
staticLibraryPrefix: "lib"
dynamicLibraryPrefix: ""
executablePrefix: ""
staticLibrarySuffix: ".a"
supportedStaticLibrarySuffixes: [".a", ".lib"]
dynamicLibrarySuffix: ".dll"
executableSuffix: ".exe"
windowsApiCharacterSet: "unicode"
platformDefines: base.concat(Windows.characterSetDefines(windowsApiCharacterSet))
compilerDefines: ['__GNUC__', 'WIN32', '_WIN32']
property string windresName: 'windres'
property path windresPath: { return toolchainPathPrefix + windresName }
setupBuildEnvironment: {
var v = new ModUtils.EnvironmentVariable("PATH", ";", true);
v.prepend(toolchainInstallPath);
v.set();
}
setupRunEnvironment: {
var v = new ModUtils.EnvironmentVariable("PATH", ";", true);
v.prepend(toolchainInstallPath);
v.set();
}
FileTagger {
patterns: ["*.rc"]
fileTags: ["rc"]
}
Rule {
inputs: ["rc"]
Artifact {
fileName: ".obj/" + product.name + "/" + input.baseDir.replace(':', '') + "/" + input.completeBaseName + "_res.o"
fileTags: ["obj"]
}
prepare: {
var platformDefines = ModUtils.moduleProperty(input, 'platformDefines');
var defines = ModUtils.moduleProperties(input, 'defines');
var includePaths = ModUtils.moduleProperties(input, 'includePaths');
var systemIncludePaths = ModUtils.moduleProperties(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.filePath, '-o', output.filePath]);
var cmd = new Command(ModUtils.moduleProperty(product, "windresPath"), args);
cmd.description = 'compiling ' + FileInfo.fileName(input.filePath);
cmd.highlight = 'compiler';
return cmd;
}
}
}
|