Make -static -opengl dynamic builds succeed
Right now it breaks in qwindowseglcontext due to its ifdefs for static ANGLE-only builds. The checks for QT_STATIC should be extended with QT_OPENGL_DYNAMIC so that it continues to resolve functions dynamically in -opengl dynamic builds even when combined with -static. Task-number: QTBUG-43993 Change-Id: Iac6d0353ef16a32a22ab1db0a833fbb0165f328c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
23996a9e40
commit
6a081125a5
@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
QWindowsLibEGL QWindowsEGLStaticContext::libEGL;
|
QWindowsLibEGL QWindowsEGLStaticContext::libEGL;
|
||||||
QWindowsLibGLESv2 QWindowsEGLStaticContext::libGLESv2;
|
QWindowsLibGLESv2 QWindowsEGLStaticContext::libGLESv2;
|
||||||
|
|
||||||
#ifndef QT_STATIC
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
|
|
||||||
#ifdef Q_CC_MINGW
|
#ifdef Q_CC_MINGW
|
||||||
static void *resolveFunc(HMODULE lib, const char *name)
|
static void *resolveFunc(HMODULE lib, const char *name)
|
||||||
@ -111,7 +111,7 @@ void *QWindowsLibEGL::resolve(const char *name)
|
|||||||
|
|
||||||
#endif // !QT_STATIC
|
#endif // !QT_STATIC
|
||||||
|
|
||||||
#ifndef QT_STATIC
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
# define RESOLVE(signature, name) signature(resolve( #name ));
|
# define RESOLVE(signature, name) signature(resolve( #name ));
|
||||||
#else
|
#else
|
||||||
# define RESOLVE(signature, name) signature(&::name);
|
# define RESOLVE(signature, name) signature(&::name);
|
||||||
@ -127,7 +127,7 @@ bool QWindowsLibEGL::init()
|
|||||||
|
|
||||||
qCDebug(lcQpaGl) << "Qt: Using EGL from" << dllName;
|
qCDebug(lcQpaGl) << "Qt: Using EGL from" << dllName;
|
||||||
|
|
||||||
#ifndef QT_STATIC
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
m_lib = ::LoadLibraryW((const wchar_t *) QString::fromLatin1(dllName).utf16());
|
m_lib = ::LoadLibraryW((const wchar_t *) QString::fromLatin1(dllName).utf16());
|
||||||
if (!m_lib) {
|
if (!m_lib) {
|
||||||
qErrnoWarning(::GetLastError(), "Failed to load %s", dllName);
|
qErrnoWarning(::GetLastError(), "Failed to load %s", dllName);
|
||||||
@ -159,7 +159,7 @@ bool QWindowsLibEGL::init()
|
|||||||
return eglGetError && eglGetDisplay && eglInitialize;
|
return eglGetError && eglGetDisplay && eglInitialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_STATIC
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
void *QWindowsLibGLESv2::resolve(const char *name)
|
void *QWindowsLibGLESv2::resolve(const char *name)
|
||||||
{
|
{
|
||||||
void *proc = m_lib ? resolveFunc(m_lib, name) : 0;
|
void *proc = m_lib ? resolveFunc(m_lib, name) : 0;
|
||||||
@ -179,7 +179,7 @@ bool QWindowsLibGLESv2::init()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
qCDebug(lcQpaGl) << "Qt: Using OpenGL ES 2.0 from" << dllName;
|
qCDebug(lcQpaGl) << "Qt: Using OpenGL ES 2.0 from" << dllName;
|
||||||
#ifndef QT_STATIC
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
m_lib = ::LoadLibraryW((const wchar_t *) QString::fromLatin1(dllName).utf16());
|
m_lib = ::LoadLibraryW((const wchar_t *) QString::fromLatin1(dllName).utf16());
|
||||||
if (!m_lib) {
|
if (!m_lib) {
|
||||||
qErrnoWarning(::GetLastError(), "Failed to load %s", dllName);
|
qErrnoWarning(::GetLastError(), "Failed to load %s", dllName);
|
||||||
|
@ -74,7 +74,7 @@ struct QWindowsLibEGL
|
|||||||
__eglMustCastToProperFunctionPointerType (EGLAPIENTRY * eglGetProcAddress)(const char *procname);
|
__eglMustCastToProperFunctionPointerType (EGLAPIENTRY * eglGetProcAddress)(const char *procname);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef QT_STATIC
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
void *resolve(const char *name);
|
void *resolve(const char *name);
|
||||||
HMODULE m_lib;
|
HMODULE m_lib;
|
||||||
#endif
|
#endif
|
||||||
@ -83,7 +83,8 @@ private:
|
|||||||
struct QWindowsLibGLESv2
|
struct QWindowsLibGLESv2
|
||||||
{
|
{
|
||||||
bool init();
|
bool init();
|
||||||
#ifndef QT_STATIC
|
|
||||||
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
void *moduleHandle() const { return m_lib; }
|
void *moduleHandle() const { return m_lib; }
|
||||||
#else
|
#else
|
||||||
void *moduleHandle() const { return Q_NULLPTR; }
|
void *moduleHandle() const { return Q_NULLPTR; }
|
||||||
@ -238,7 +239,7 @@ struct QWindowsLibGLESv2
|
|||||||
void (APIENTRY * glDepthRangef)(GLclampf nearVal, GLclampf farVal);
|
void (APIENTRY * glDepthRangef)(GLclampf nearVal, GLclampf farVal);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef QT_STATIC
|
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
|
||||||
void *resolve(const char *name);
|
void *resolve(const char *name);
|
||||||
HMODULE m_lib;
|
HMODULE m_lib;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user