diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf index cd3a0cf8cd..e0383ef530 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 + 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() }