From ced5e2f0e8353a9caa8fbbaaa82d15f7eba3d159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 8 Apr 2013 12:17:27 +0200 Subject: 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 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/mac/sdk.prf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 10d94bed11..db33291b99 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -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) } -- cgit v1.2.3