Mac: Fix compilation with -sdk option
authorEike Ziller <eike.ziller@digia.com>
Wed, 31 Oct 2012 09:50:43 +0000 (10:50 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 23 Nov 2012 09:08:10 +0000 (10:08 +0100)
The include paths that the mkspecs set into the OpenGL/AGL frameworks
must take the SDK into account.
(The headers in 10.8 have slightly changed wrt 10.7, leading to compile
errors because framework style includes (<OpenGL/foo.h>) within the system
headers are resolved to the SDK framework headers.)

Change-Id: I6113cdb95b462d587f593682e03e81e920f3f672
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
configure
mkspecs/common/mac.conf

index fa8a535..a449369 100755 (executable)
--- a/configure
+++ b/configure
@@ -1283,6 +1283,7 @@ while [ "$#" -gt 0 ]; do
     sdk)
         if [ "$BUILD_ON_MAC" = "yes" ]; then
             CFG_SDK="$VAL"
+            DeviceVar set QMAKE_MAC_SDK "$VAL"
         else
             UNKNOWN_OPT=yes
         fi
@@ -6092,11 +6093,6 @@ elif [ "$CFG_OPENSSL" = "linked" ]; then
     echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$QTMODULE.tmp"
 fi
 
-#dump in the SDK info
-if [ '!' -z "$CFG_SDK" ]; then
-   echo "QMAKE_MAC_SDK = $CFG_SDK" >> "$QTMODULE.tmp"
-fi
-
 # cmdline args
 cat "$QMAKE_VARS_FILE" >> "$QTMODULE.tmp"
 rm -f "$QMAKE_VARS_FILE" 2>/dev/null
index 9830110..e318cb7 100644 (file)
@@ -1,6 +1,9 @@
 #
 # qmake configuration for common Mac OS X
 #
+!load(device_config) {
+    error(Could not successfully load device configuration)
+}
 
 QMAKE_PLATFORM += macx mac
 
@@ -9,8 +12,8 @@ QMAKE_RESOURCE         = /Developer/Tools/Rez
 QMAKE_EXTENSION_SHLIB  = dylib
 
 QMAKE_LIBDIR           =
-QMAKE_INCDIR_OPENGL    = /System/Library/Frameworks/OpenGL.framework/Headers \
-       /System/Library/Frameworks/AGL.framework/Headers/
+QMAKE_INCDIR_OPENGL    = $$QMAKE_MAC_SDK/System/Library/Frameworks/OpenGL.framework/Headers \
+       $$QMAKE_MAC_SDK/System/Library/Frameworks/AGL.framework/Headers/
 
 QMAKE_FIX_RPATH         = install_name_tool -id