summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-07-04 16:27:01 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2013-07-04 19:34:16 +0200
commita912e57e189847509efd75d8a4563ad8c7aa1079 (patch)
treeaa4ec314a6d5e3b50f4533697ff33c057f2c1be3 /build
parent57a9ba3f7cae93f1790be8df508f4fe82d9953e5 (diff)
Introduce $$which qmake function
With a unix only implementation for now. We're gonna need this to resolve toolchains' paths since gyp won't take anything but a relative or an absolute path. Change-Id: I4646deee0a17ce0f929d987d98826eaad524cf25 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'build')
-rw-r--r--build/qmake/mkspecs/features/functions.prf18
1 files changed, 17 insertions, 1 deletions
diff --git a/build/qmake/mkspecs/features/functions.prf b/build/qmake/mkspecs/features/functions.prf
index 979c3c302..4890c19be 100644
--- a/build/qmake/mkspecs/features/functions.prf
+++ b/build/qmake/mkspecs/features/functions.prf
@@ -42,9 +42,25 @@ defineReplace(mocOutput) {
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 = $$system("which ninja 2>/dev/null")
+ 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)