From 8548008f53bbcebf65580304c89ea9d2a265bd85 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 30 Aug 2021 20:54:00 +0200 Subject: Enable no opengl builds By mistake opengl was marked as required library, but should be just optional. Fix compilation issues. This should enable build on yet another coin node. Pick-to: 6.2 Change-Id: Id87404928e6b042d902fcfe0a7fed99a6806456f Reviewed-by: Allan Sandfeld Jensen --- src/core/web_engine_context.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/core/web_engine_context.cpp') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index c9f82c31c..24df73bc8 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -132,8 +132,8 @@ #include #include #if QT_CONFIG(opengl) -# include -# include +#include +#include #endif #include #include @@ -246,7 +246,7 @@ static const char *getGLType(bool enableGLSoftwareRendering) return glType; } #else -static cont char *getGLType(bool enableGLSoftwareRendering) +static const char *getGLType(bool enableGLSoftwareRendering) { return nullptr; } @@ -262,6 +262,7 @@ static void logContext(const char *glType, base::CommandLine *cmd) { QLoggingCategory webEngineContextLog("qt.webenginecontext"); if (webEngineContextLog.isInfoEnabled()) { +#if QT_CONFIG(opengl) const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format(); const auto profile = QMetaEnum::fromType().valueToKey( sharedFormat.profile()); @@ -284,6 +285,9 @@ static void logContext(const char *glType, base::CommandLine *cmd) glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(), usingDefaultSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no", usingANGLE() ? "yes" : "no", qPrintable(params.join(" "))); +#else + qCInfo(webEngineContextLog) << "WebEngine compiled with no opengl enabled."; +#endif //QT_CONFIG(opengl) } } @@ -737,6 +741,7 @@ WebEngineContext::WebEngineContext() const char *glType = getGLType(enableGLSoftwareRendering); if (glType) { +#if QT_CONFIG(opengl) parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType); parsedCommandLine->AppendSwitch(switches::kInProcessGPU); if (enableGLSoftwareRendering) { @@ -766,6 +771,7 @@ WebEngineContext::WebEngineContext() if (!usingANGLE() || isGLES2Context) parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext); #endif +#endif //QT_CONFIG(opengl) } else { parsedCommandLine->AppendSwitch(switches::kDisableGpu); } -- cgit v1.2.3