diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-04-08 16:41:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-09 10:03:26 +0200 |
commit | f73a7ca46cb15d77608a4995921b4d501c21bdee (patch) | |
tree | 27bf2a9fd3907b881b5dd19116d0219682060877 /mkspecs/common | |
parent | 4f002f325614ef2c5f893c6fffffd76ec4796bb2 (diff) |
Verify Xcode installation more thoroughly before relying on it
We depend on Xcode for building Qt itself and user application on Mac OS.
The user may have an Xcode install that is not set up properly, in which
case we would fail compilation in mysterious ways. Instead we try to
detect misconfigured or missing Xcode installs as early as possible.
We try to detect if an Xcode install has not been chosen yet, and
if the user has not accepted the Xcode license agreement. We need to
do these checks both in configure, as early as possible, and in mkspecs
on Mac OS, as we need to error out if the user tries to build an app
with the Qt SDK, but with a broken Xcode install.
Change-Id: I4e3a11077a61dc5d4ee2c686d01044a9bb2c1c79
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'mkspecs/common')
-rw-r--r-- | mkspecs/common/mac.conf | 3 | ||||
-rw-r--r-- | mkspecs/common/xcode.conf | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf index cf54f3f580..f31db3bb4b 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -26,4 +26,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cq QMAKE_RANLIB = ranlib -s +# We rely on Xcode to build +include(xcode.conf) + include(unix.conf) diff --git a/mkspecs/common/xcode.conf b/mkspecs/common/xcode.conf index 0095469421..b15266b678 100644 --- a/mkspecs/common/xcode.conf +++ b/mkspecs/common/xcode.conf @@ -3,7 +3,7 @@ # # Get path of Xcode's Developer directory -QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path") +QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null") isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \ error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.") @@ -11,6 +11,10 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \ !exists($$QMAKE_XCODE_DEVELOPER_PATH): \ error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.") +# Make sure Xcode is set up properly +isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \ + error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.") + # Extract Xcode version using xcodebuild xcode_version = $$system("/usr/bin/xcodebuild -version") QMAKE_XCODE_VERSION = $$member(xcode_version, 1) |