From 90963a1b2178660ef924fcd7e481c3ccfeaff935 Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sat, 8 Feb 2014 12:56:41 +0100 Subject: [PATCH] compiler.pri: tweak OS X SDK detection when building with Qt 4. In Xcode 5, the xcrun tool includes a --show-sdk-path parameter which, as the name implies, can be used to query the system for a usable OS X SDK path. However, xcrun in Xcode 4 does *not* include this parameter. We used this parameter unconditionally, which lead to failures when using building against Qt 4 when using Xcode 4. This change modifies the SDK selection code to first attempt to query for the OS X sdk using the --show-sdk-path parameter. If that fails, we try to fall back to using a 10.8 SDK living in a DEVELOPER_DIR found via xcode-select --print-path. If that doesn't exist either, we warn the user and abort the build. This should allow people to build Mumble on most systems without having to resort to manual .pro file editing. --- compiler.pri | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler.pri b/compiler.pri index 8b2b54383..c368bd194 100644 --- a/compiler.pri +++ b/compiler.pri @@ -143,7 +143,14 @@ macx { isEqual(QT_MAJOR_VERSION, 5) { QMAKE_MAC_SDK = macosx } else { - QMAKE_MAC_SDK = $$system(xcrun --sdk macosx --show-sdk-path) + QMAKE_MAC_SDK = $$system(xcrun --sdk macosx --show-sdk-path 2>/dev/null) + isEmpty(QMAKE_MAC_SDK) { + QMAKE_MAC_SDK = $$system(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk + !exists($$QMAKE_MAC_SDK) { + message("Unable to find usable OS X SDK") + error("Aborting build") + } + } } QMAKE_CC = $$system(xcrun -find clang)