blob: 896c0efb06946127d4716350eb43accb7fa824b4 (
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
|
Fix QMAKE_CXX/CROSS_COMPILE verification with ccache
The use of ccache leads to QMAKE_CXX definitions of the form:
QMAKE_CXX = $${CCACHE} $${CROSS_COMPILE}g++
The previous test required QMAKE_CXX to be a single valid (absolute or
QMAKE_PATH_ENV-relative) path to an existing file, which was not
compatible with definitions of QMAKE_CXX like the one above.
Fix this by using only the first value in QMAKE_CXX, which usually
points to the compiler executable, or to the ccache executable in the
above case.
Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
---
mkspecs/features/device_config.prf | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
index cd3a0cf..eee4ac6 100644
--- a/mkspecs/features/device_config.prf
+++ b/mkspecs/features/device_config.prf
@@ -19,10 +19,15 @@ defineTest(deviceSanityCheckCompiler) {
else: \
sfx =
+ # Build the compiler filename using the first value in QMAKE_CXX in order to
+ # support tools like ccache, which give QMAKE_CXX values of the form:
+ # ccache <path_to_compiler>
+ compiler = $$first(QMAKE_CXX)$$sfx
+
# Check if the binary exists with an absolute path. Do this check
# before the CROSS_COMPILE empty check below to allow the mkspec
# to derive the compiler path from other device options.
- exists($$QMAKE_CXX$$sfx):return()
+ exists($$compiler):return()
# Check for possible reasons of failure
# check if CROSS_COMPILE device-option is set
@@ -31,7 +36,7 @@ defineTest(deviceSanityCheckCompiler) {
# Check if QMAKE_CXX points to an executable.
ensurePathEnv()
for (dir, QMAKE_PATH_ENV) {
- exists($$dir/$${QMAKE_CXX}$$sfx): \
+ exists($$dir/$${compiler}): \
return()
}
|