diff options
author | Jan Arve Saether <jan-arve.saether@qt.io> | 2016-10-25 16:56:02 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@theqtcompany.com> | 2016-10-28 11:02:43 +0000 |
commit | 780105f9062dec350bbe2a6800c40db3e6382578 (patch) | |
tree | a93a0febd9c0c19636d4077415761e6b01b25392 /mkspecs | |
parent | 1ad6ae21f015ead3dcc4bed21a988f0d7d5d0d2d (diff) |
Merge ANGLE's libEGL and libGLESv2 into QtANGLE
This is needed in order to be able to specify a custom location of
the ANGLE libs, and enables us to perform a LoadLibrary of ANGLE libs
by just having the absolute path to QtANGLE.dll as the argument to
LoadLibrary().
Previously, we had two ANGLE libraries: libEGL and libGLESv2. libEGL hard
linked against libGLESv2. If we wanted to load libEGL from a custom
location, we couldn't load libEGL by calling LoadLibrary with the absolute
path to libEGL, because libEGL had problems finding libGLESv2. One
solution to that could have been to call SetDllDirectory() with the path
to the ANGLE libs before calling LoadLibrary("libEGL.dll"). Since the DLL
directory would point to both ANGLE libs, this would ensure that the libGLESv2
was also found. Unfortunately, this approach is not thread safe
(SetDllDirectory will affect all subsequent LoadLibrary(Ex) from the same
process). Therefore, we chose to merge the two libraries into one to
circumvent the whole problem.
At the same time, this patch also enables loading of two different ANGLE
libraries into the same process at once without renaming them: This was
not possible before because libEGL hard linked to libGLESv2.dll. When
libGLESv2.dll was already loaded, the second instance of libEGL would
simply link against the already loaded version of libGLESv2.dll.
This behavior is documented in the LoadLibraryEx documentation on MSDN:
"If the string specifies a module name without a path and more than one
loaded module has the same base name and extension, the function returns a
handle to the module that was loaded first."
Change-Id: Ic1d886ba802be72ddcf01235bafaedcef662762e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/common/angle.conf | 9 | ||||
-rw-r--r-- | mkspecs/common/msvc-desktop.conf | 7 | ||||
-rw-r--r-- | mkspecs/common/windows-gles.conf | 7 | ||||
-rw-r--r-- | mkspecs/common/winrt_winphone/qmake.conf | 5 | ||||
-rw-r--r-- | mkspecs/win32-g++/qmake.conf | 8 | ||||
-rw-r--r-- | mkspecs/win32-icc/qmake.conf | 9 |
6 files changed, 21 insertions, 24 deletions
diff --git a/mkspecs/common/angle.conf b/mkspecs/common/angle.conf deleted file mode 100644 index fffdb581c5..0000000000 --- a/mkspecs/common/angle.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Renaming these files requires that the LIBRARY entry of their corresponding -# def files are also updated to reflect the name. -# The .def files are found in the angle directories: -# -# qtbase\src\3rdparty\angle\src\libEGL\libEGL[d?].def -# qtbase\src\3rdparty\angle\src\libEGL\libGLESv2[d?].def - -LIBEGL_NAME="libEGL" -LIBGLESV2_NAME="libGLESv2" diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index 1b9d57bff0..b72cdff252 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -9,8 +9,6 @@ isEmpty(MSC_VER)|isEmpty(MSVC_VER): error("Source mkspec must set both MSC_VER a # Baseline: Visual Studio 2005 (8.0), VC++ 14.0 # -include(angle.conf) - MAKEFILE_GENERATOR = MSVC.NET QMAKE_PLATFORM = win32 QMAKE_COMPILER = msvc @@ -92,8 +90,8 @@ QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib QMAKE_LIBS_NETWORK = ws2_32.lib QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib -QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib gdi32.lib user32.lib -QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib gdi32.lib user32.lib +QMAKE_LIBS_OPENGL_ES2 = gdi32.lib user32.lib +QMAKE_LIBS_OPENGL_ES2_DEBUG = gdi32.lib user32.lib QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib QMAKE_LIBS_QT_ENTRY = -lqtmain @@ -107,5 +105,6 @@ VCSOLUTION_EXTENSION = .sln VCPROJ_KEYWORD = Qt4VSv1.0 include(msvc-base.conf) +include(windows-gles.conf) unset(MSC_VER) diff --git a/mkspecs/common/windows-gles.conf b/mkspecs/common/windows-gles.conf new file mode 100644 index 0000000000..6781158cc1 --- /dev/null +++ b/mkspecs/common/windows-gles.conf @@ -0,0 +1,7 @@ +# Output name of Qt's ANGLE GLES library. (Note that this is different from upstream ANGLE) +LIBQTANGLE_NAME = QtANGLE + +# Set up .lib files used for linking +QMAKE_LIBS_OPENGL_ES2 = -l$${LIBQTANGLE_NAME} $$QMAKE_LIBS_OPENGL_ES2 +QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBQTANGLE_NAME}d $$QMAKE_LIBS_OPENGL_ES2 + diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf index 05c9bd39a5..0c3af4a7a8 100644 --- a/mkspecs/common/winrt_winphone/qmake.conf +++ b/mkspecs/common/winrt_winphone/qmake.conf @@ -4,8 +4,6 @@ # Written for Microsoft Visual C++ # -include(../angle.conf) - MAKEFILE_GENERATOR = MSBUILD QMAKE_COMPILER = msvc QMAKE_PLATFORM = winrt win32 @@ -80,8 +78,6 @@ QMAKE_LIBS += runtimeobject.lib QMAKE_LIBS_CORE += ws2_32.lib QMAKE_LIBS_GUI = QMAKE_LIBS_NETWORK += ws2_32.lib -QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib -QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib QMAKE_LIBS_QT_ENTRY = -lqtmain @@ -98,6 +94,7 @@ WINRT_MANIFEST.capabilities = defaults WINRT_MANIFEST.capabilities_device = defaults include(../msvc-base.conf) +include(../windows-gles.conf) unset(MSC_VER) diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 6ed39745ae..bb172f46a6 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -8,7 +8,6 @@ # load(device_config) -include(../common/angle.conf) MAKEFILE_GENERATOR = MINGW QMAKE_PLATFORM = win32 mingw @@ -100,8 +99,8 @@ QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 QMAKE_LIBS_NETWORK = -lws2_32 QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32 -QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -lgdi32 -luser32 -QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME}d -l$${LIBGLESV2_NAME}d -lgdi32 -luser32 +QMAKE_LIBS_OPENGL_ES2 = -lgdi32 -luser32 +QMAKE_LIBS_OPENGL_ES2_DEBUG = -lgdi32 -luser32 QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32 QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain @@ -113,4 +112,7 @@ QMAKE_STRIP = $${CROSS_COMPILE}strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy QMAKE_NM = $${CROSS_COMPILE}nm -P + +include(../common/windows-gles.conf) + load(qt_config) diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index dd54131526..e19570bf16 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -4,8 +4,6 @@ # Written for Intel C++ # -include(../common/angle.conf) - MAKEFILE_GENERATOR = MSVC.NET QMAKE_PLATFORM = win32 CONFIG += incremental flat debug_and_release debug_and_release_target @@ -89,8 +87,8 @@ QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib QMAKE_LIBS_NETWORK = ws2_32.lib QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib delayimp.lib -QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib gdi32.lib user32.lib -QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib gdi32.lib user32.lib +QMAKE_LIBS_OPENGL_ES2 = gdi32.lib user32.lib +QMAKE_LIBS_OPENGL_ES2_DEBUG = gdi32.lib user32.lib QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib QMAKE_LIBS_QT_ENTRY = -lqtmain @@ -99,4 +97,7 @@ QMAKE_LIB = xilib /NOLOGO QMAKE_RC = rc DSP_EXTENSION = .dsp + +include(../common/windows-gles.conf) + load(qt_config) |