Handle errors when sysrooting tools on Mac

xcrun will spit out errors to stderr and nothing to stdout if it fails
to find the tool in question. By checking for an empty return value and
skipping the sysrooting we guard against mangling the tool variable.

Change-Id: I68f59a6c8116696dd75cceed7b33ac666f3468b2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-04-08 12:17:27 +02:00 committed by The Qt Project
parent 7a66f6b60e
commit ced5e2f0e8

View File

@ -24,7 +24,9 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
value = $$eval($$tool)
isEmpty(value): next()
sysrooted = $$system("xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value)")
sysrooted = $$system("xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
isEmpty(sysrooted): next()
$$tool = $$sysrooted $$member(value, 1, -1)
}