rectify opengl configuration under windows

angle is an implementation of es2 and thus autodetected if es2 is
requested.
but this also means that it is actually *not* mutually exclusive
with dynamicgl - quite the opposite. express that sensibly in the
build system. this implies that we will now get sensible messages
from configure if angle is not detected while building with dynamicgl.

furthermore, this simplifies the handling of defaults, removes the
unnecessary case in checkAvailability() (checkAngleAvailability() is
always called directly), fixes the complaint on winrt if gles2 is
disabled, and avoids redundant checks for the purpose of obtaining
an error message.

Change-Id: I3373f0ad7d5484d1bac8dbde3f8ee6fca89ebcb8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-07-07 16:36:26 +02:00
parent a64d1d5499
commit 0492f4a4c5
3 changed files with 18 additions and 37 deletions

View File

@ -18,7 +18,7 @@ MODULE_PLUGIN_TYPES = \
egldeviceintegrations egldeviceintegrations
# This is here only because the platform plugin is no module, obviously. # This is here only because the platform plugin is no module, obviously.
win32:contains(QT_CONFIG, angle)|contains(QT_CONFIG, dynamicgl) { contains(QT_CONFIG, angle) {
MODULE_AUX_INCLUDES = \ MODULE_AUX_INCLUDES = \
\$\$QT_MODULE_INCLUDE_BASE/QtANGLE \$\$QT_MODULE_INCLUDE_BASE/QtANGLE
} }

View File

@ -163,7 +163,7 @@ contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent
SUBDIRS += src_3rdparty_harfbuzzng SUBDIRS += src_3rdparty_harfbuzzng
src_gui.depends += src_3rdparty_harfbuzzng src_gui.depends += src_3rdparty_harfbuzzng
} }
win32:contains(QT_CONFIG, angle)|contains(QT_CONFIG, dynamicgl) { contains(QT_CONFIG, angle) {
SUBDIRS += src_angle SUBDIRS += src_angle
src_gui.depends += src_angle src_gui.depends += src_angle
} }

View File

@ -245,7 +245,7 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
dictionary[ "ICU" ] = "no"; dictionary[ "ICU" ] = "no";
dictionary[ "ANGLE" ] = "auto"; dictionary[ "ANGLE" ] = "auto";
dictionary[ "DYNAMICGL" ] = "auto"; dictionary[ "DYNAMICGL" ] = "no";
dictionary[ "GIF" ] = "yes"; dictionary[ "GIF" ] = "yes";
dictionary[ "JPEG" ] = "yes"; dictionary[ "JPEG" ] = "yes";
@ -1508,8 +1508,6 @@ void Configure::applySpecSpecifics()
dictionary[ "LIBJPEG" ] = "qt"; dictionary[ "LIBJPEG" ] = "qt";
dictionary[ "LIBPNG" ] = "qt"; dictionary[ "LIBPNG" ] = "qt";
dictionary[ "FREETYPE" ] = "yes"; dictionary[ "FREETYPE" ] = "yes";
dictionary[ "OPENGL" ] = "yes";
dictionary[ "OPENGL_ES_2" ] = "yes";
dictionary[ "SSL" ] = "yes"; dictionary[ "SSL" ] = "yes";
dictionary[ "OPENSSL" ] = "no"; dictionary[ "OPENSSL" ] = "no";
dictionary[ "DBUS" ] = "no"; dictionary[ "DBUS" ] = "no";
@ -1517,8 +1515,6 @@ void Configure::applySpecSpecifics()
dictionary[ "PCRE" ] = "qt"; dictionary[ "PCRE" ] = "qt";
dictionary[ "ICU" ] = "qt"; dictionary[ "ICU" ] = "qt";
dictionary[ "LARGE_FILE" ] = "no"; dictionary[ "LARGE_FILE" ] = "no";
dictionary[ "ANGLE" ] = "yes";
dictionary[ "DYNAMICGL" ] = "no";
} else if (dictionary.value("XQMAKESPEC").startsWith("linux")) { //TODO actually wrong. } else if (dictionary.value("XQMAKESPEC").startsWith("linux")) { //TODO actually wrong.
//TODO //TODO
dictionary[ "STYLE_WINDOWSXP" ] = "no"; dictionary[ "STYLE_WINDOWSXP" ] = "no";
@ -2046,10 +2042,6 @@ bool Configure::checkAvailability(const QString &part)
else if (part == "ICU") else if (part == "ICU")
available = tryCompileProject("unix/icu"); available = tryCompileProject("unix/icu");
else if (part == "ANGLE") {
available = checkAngleAvailability();
}
else if (part == "HARFBUZZ") else if (part == "HARFBUZZ")
available = tryCompileProject("unix/harfbuzz"); available = tryCompileProject("unix/harfbuzz");
@ -2214,18 +2206,16 @@ void Configure::autoDetection()
// ANGLE detection // ANGLE detection
if (dictionary["ANGLE"] == "auto") { if (dictionary["ANGLE"] == "auto") {
if (dictionary["OPENGL_ES_2"] == "yes") { if (dictionary["OPENGL_ES_2"] == "yes" || dictionary["DYNAMICGL"] == "yes") {
dictionary["ANGLE"] = checkAngleAvailability() ? "yes" : "no"; QString err;
dictionary["ANGLE"] = checkAngleAvailability(&err) ? "yes" : "no";
dictionary["ANGLE_FROM"] = "detected"; dictionary["ANGLE_FROM"] = "detected";
dictionary["ANGLE_ERR"] = err;
} else { } else {
dictionary["ANGLE"] = "no"; dictionary["ANGLE"] = "no";
} }
} }
// Dynamic GL. This must be explicitly requested, no autodetection.
if (dictionary["DYNAMICGL"] == "auto")
dictionary["DYNAMICGL"] = "no";
// Image format detection // Image format detection
if (dictionary["LIBJPEG"] == "auto") if (dictionary["LIBJPEG"] == "auto")
dictionary["LIBJPEG"] = checkAvailability("LIBJPEG") ? defaultTo("LIBJPEG") : "qt"; dictionary["LIBJPEG"] = checkAvailability("LIBJPEG") ? defaultTo("LIBJPEG") : "qt";
@ -2439,43 +2429,34 @@ bool Configure::verifyConfiguration()
prompt = true; prompt = true;
} }
// -angle given on command line, but Direct X cannot be found. if (dictionary["ANGLE"] == "no") {
if (dictionary["ANGLE"] != "no") {
QString errorMessage;
if (!checkAngleAvailability(&errorMessage)) {
cout << "WARNING: ANGLE specified, but the DirectX SDK could not be detected:" << endl
<< " " << qPrintable(errorMessage) << endl
<< "The build will most likely fail." << endl;
prompt = true;
}
} else if (dictionary["ANGLE"] == "no") {
if (dictionary["ANGLE_FROM"] == "detected") { if (dictionary["ANGLE_FROM"] == "detected") {
QString errorMessage; QString errorMessage = dictionary["ANGLE_ERR"];
checkAngleAvailability(&errorMessage);
cout << "WARNING: The DirectX SDK could not be detected:" << endl cout << "WARNING: The DirectX SDK could not be detected:" << endl
<< " " << qPrintable(errorMessage) << endl << " " << qPrintable(errorMessage) << endl
<< "Disabling the ANGLE backend." << endl; << "Disabling the ANGLE backend." << endl;
prompt = true; prompt = true;
} }
if ((dictionary["OPENGL_ES_2"] == "yes") && !dictionary.contains("XQMAKESPEC")) { if (dictionary["OPENGL_ES_2"] == "yes"
&& (platform() == WINDOWS || platform() == WINDOWS_RT)) {
cout << endl << "WARNING: Using OpenGL ES 2.0 without ANGLE." << endl cout << endl << "WARNING: Using OpenGL ES 2.0 without ANGLE." << endl
<< "Specify -opengl desktop to use Open GL." << endl << "Specify -opengl desktop to use Open GL." << endl
<< "The build will most likely fail." << endl; << "The build will most likely fail." << endl;
prompt = true; prompt = true;
} }
} } else if (dictionary["ANGLE_FROM"] == "commandline") {
QString errorMessage;
if (dictionary["DYNAMICGL"] == "yes") { if (!checkAngleAvailability(&errorMessage)) {
if (dictionary["OPENGL_ES_2"] == "yes" || dictionary["ANGLE"] != "no") { cout << "WARNING: ANGLE specified, but the DirectX SDK could not be detected:" << endl
cout << "ERROR: Dynamic OpenGL cannot be used with -angle." << endl; << " " << qPrintable(errorMessage) << endl
dictionary[ "DONE" ] = "error"; << "The build will most likely fail." << endl;
} }
} }
if (dictionary["OPENGL"] == "no" || dictionary["OPENGL_ES_2"] == "no") { if (dictionary["OPENGL"] == "no" || dictionary["OPENGL_ES_2"] == "no") {
if (dictionary.value("XQMAKESPEC").startsWith("winphone") || if (dictionary.value("XQMAKESPEC").startsWith("winphone") ||
dictionary.value("XQMAKESPEC").startsWith("winrt")) { dictionary.value("XQMAKESPEC").startsWith("winrt")) {
cout << "ERROR: Option -no-opengl is not valid for WinRT." << endl; cout << "ERROR: Only '-opengl es2' is valid for WinRT." << endl;
dictionary[ "DONE" ] = "error"; dictionary[ "DONE" ] = "error";
} }
} }