Fix determination of OpenGL include paths on macOS, take 2

The sysrootification of OpenGL include paths must be done only once: at
configure time. The resolved paths are stored since 521a8539 and must not be
resolved again.

Turn the makeSpec-type opengl library into a custom-type one, and do
the sysrootification in the handler function.

Fixes: QTBUG-73736
Change-Id: I2933144057d6f01d8bfc7bda2c2df56c57303459
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Joerg Bornemann 2019-02-20 09:47:27 +01:00
parent 2c31516a1e
commit 49ef377349
4 changed files with 13 additions and 6 deletions

View File

@ -17,7 +17,7 @@ QMAKE_EXTENSION_SHLIB = dylib
QMAKE_EXTENSIONS_AUX_SHLIB = tbd QMAKE_EXTENSIONS_AUX_SHLIB = tbd
QMAKE_LIBDIR = QMAKE_LIBDIR =
# sdk.prf will prefix the proper SDK sysroot # qtConfLibrary_openglMakeSpec will prefix the proper SDK sysroot
QMAKE_INCDIR_OPENGL = \ QMAKE_INCDIR_OPENGL = \
/System/Library/Frameworks/OpenGL.framework/Headers \ /System/Library/Frameworks/OpenGL.framework/Headers \
/System/Library/Frameworks/AGL.framework/Headers/ /System/Library/Frameworks/AGL.framework/Headers/

View File

@ -33,10 +33,6 @@ QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath) QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion) QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
sysrootified =
for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
QMAKE_INCDIR_OPENGL = $$sysrootified
QMAKESPEC_NAME = $$basename(QMAKESPEC) QMAKESPEC_NAME = $$basename(QMAKESPEC)
# Resolve SDK version of various tools # Resolve SDK version of various tools

View File

@ -448,7 +448,7 @@
], ],
"sources": [ "sources": [
{ "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" }, { "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" },
{ "type": "makeSpec", "spec": "OPENGL" } { "type": "openglMakeSpec" }
] ]
}, },
"opengl_es2": { "opengl_es2": {

View File

@ -15,6 +15,17 @@ defineTest(qtConfLibrary_freetype) {
return(true) return(true)
} }
defineTest(qtConfLibrary_openglMakeSpec) {
darwin:sdk {
sysrootified =
for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
QMAKE_INCDIR_OPENGL = $$sysrootified
}
$${1}.spec = OPENGL
!qtConfLibrary_makeSpec($$1, $$2): return(false)
return(true)
}
# Check for Direct X shader compiler 'fxc'. # Check for Direct X shader compiler 'fxc'.
# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the # Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in # DXSDK_DIR variable. Starting with Windows Kit 8, it is included in