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
80
81
|
# Map to the correct target type for gyp
defineReplace(toGypTargetType) {
equals(TEMPLATE, "app"):return("executable")
equals(TEMPLATE, "lib") {
CONFIG(static): return("static_library")
return("shared_library")
}
return("none")
}
defineReplace(getOutDir) {
# FIXME: rely on env variable in here and in the gyp_qtwebengine script, à la WEBKITOUTPUTDIR
return("$$QTWEBENGINE_ROOT/out")
}
defineReplace(getConfigDir) {
CONFIG(release, debug|release):return("Release")
return("Debug")
}
defineReplace(findMocables) {
input = $$1
for (file, input): \
infiles += $$absolute_path($$file, $$_PRO_FILE_PWD_)
mocables = $$system("$$QTWEBENGINE_ROOT/build/scripts/find-mocables $$infiles")
mocables = $$replace(mocables, $$_PRO_FILE_PWD_$${QMAKE_DIR_SEP}, '')
return($$mocables)
}
defineReplace(findIncludedMocFiles) {
input = $$1
for (file, input): \
infiles += $$absolute_path($$file, $$_PRO_FILE_PWD_)
return($$system("$$QTWEBENGINE_ROOT/build/scripts/find-included-moc-files $$infiles"))
}
defineReplace(mocOutput) {
out = $$1
# The order is important, since the output of the second replace would end up accidentaly transformed by the first one
out = $$replace(out, ^(.*)($$join(QMAKE_EXT_CPP,|)), $${QMAKE_CPP_MOD_MOC}\\1$${QMAKE_EXT_CPP_MOC})
out = $$replace(out, ^(.*)($$join(QMAKE_EXT_H,|)), $${QMAKE_H_MOD_MOC}\\1$${first(QMAKE_EXT_CPP)})
return($$out)
}
defineReplace(rccOutput) {
out = $$1
out = $$replace(out, .qrc, .cpp)
out = $$join(out, qrc_, qrc_)
return($$out)
}
defineReplace(rccExternFunc) {
out = $$1
out = $$replace(out, .qrc, )
return($$out)
}
defineReplace(which) {
out = $$1
# FIXME: figure out what to do about windows...
unix {
command = $$split(out, " ")
executable = $$first(command)
out = $$system("which $$executable 2>/dev/null")
isEmpty(out) {
message($$executable not found)
out = $$executable
}
for(arg, command): !equals(arg, $$executable): out += $$arg
}
return($$out)
}
defineReplace(findNinja) {
!isEmpty(CACHED_NINJA_EXECUTABLE):exists($$CACHED_NINJA_EXECUTABLE): return($$CACHED_NINJA_EXECUTABLE)
out = $$which(ninja)
# Try to be smart about it if we know where the chromium sources are located
!exists($$out): out = $$absolute_path("$$QTWEBENGINE_ROOT/build/ninja/ninja")
cache(CACHED_NINJA_EXECUTABLE, set, out)
return($$out)
}
|