summaryrefslogtreecommitdiffstats
path: root/build/qmake/mkspecs/features/functions.prf
blob: 8a34451709c1b814ba4448d709faa9b1ee7b3e6d (plain)
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
# 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(findNinja) {
  !isEmpty(CACHED_NINJA_EXECUTABLE):exists($$CACHED_NINJA_EXECUTABLE): return($$CACHED_NINJA_EXECUTABLE)
  out = $$system("which ninja 2>/dev/null")
  # Try to be smart about it if we know where the chromium sources are located
  isEmpty(CHROMIUM_SRC_DIR): message(foobar)
  !exists($$out): out = $$absolute_path("$$QTWEBENGINE_ROOT/build/ninja/ninja")
  cache(CACHED_NINJA_EXECUTABLE, set, out)
  return($$out)
}