From 10f4eb0e585a1a2b13d049a8d5496302a43bcafe Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Fri, 23 Sep 2022 17:40:22 +0200 Subject: [PATCH] Fix build without opengl feature Guard private includes of private opengl headers and make public opengl headers available even if feature is disabled, since they can be used by user projects. Task-number: QTBUG-103196 Change-Id: If492c97b5cfb21d8aac0d607bc7add38b6d0c73e Reviewed-by: Alexandru Croitor --- src/gui/CMakeLists.txt | 16 ++++++++++------ src/gui/kernel/qguiapplication.cpp | 4 +++- src/gui/painting/qpathsimplifier.cpp | 4 +++- src/gui/platform/unix/qunixnativeinterface.cpp | 4 +++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 2a95babc04..f6c2b2979a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -101,6 +101,7 @@ qt_internal_add_module(Gui kernel/qkeymapper.cpp kernel/qkeymapper_p.h kernel/qoffscreensurface.cpp kernel/qoffscreensurface.h kernel/qoffscreensurface_p.h kernel/qoffscreensurface_platform.h + kernel/qopenglcontext.h kernel/qpaintdevicewindow.cpp kernel/qpaintdevicewindow.h kernel/qpaintdevicewindow_p.h kernel/qpalette.cpp kernel/qpalette.h kernel/qpixelformat.cpp kernel/qpixelformat.h @@ -118,6 +119,7 @@ qt_internal_add_module(Gui kernel/qplatformmenu.cpp kernel/qplatformmenu.h kernel/qplatformmenu_p.h kernel/qplatformnativeinterface.cpp kernel/qplatformnativeinterface.h kernel/qplatformoffscreensurface.cpp kernel/qplatformoffscreensurface.h + kernel/qplatformopenglcontext.h kernel/qplatformscreen.cpp kernel/qplatformscreen.h kernel/qplatformscreen_p.h kernel/qplatformservices.cpp kernel/qplatformservices.h kernel/qplatformsessionmanager.cpp kernel/qplatformsessionmanager.h @@ -147,6 +149,10 @@ qt_internal_add_module(Gui math3d/qvector3d.h math3d/qvector4d.h math3d/qvectornd.cpp math3d/qvectornd.h + opengl/qopengl.h + opengl/qopenglext.h + opengl/qopenglfunctions.h + opengl/qopenglextrafunctions.h painting/qbackingstore.cpp painting/qbackingstore.h painting/qbackingstoredefaultcompositor.cpp painting/qbackingstoredefaultcompositor_p.h painting/qbackingstorerhisupport.cpp painting/qbackingstorerhisupport_p.h @@ -351,14 +357,12 @@ endif() qt_internal_extend_target(Gui CONDITION QT_FEATURE_opengl SOURCES - kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h + kernel/qopenglcontext.cpp kernel/qopenglcontext_p.h kernel/qopenglcontext_platform.h - kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h - opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h - opengl/qopenglext.h + kernel/qplatformopenglcontext.cpp + opengl/qopengl.cpp opengl/qopengl_p.h opengl/qopenglextensions_p.h - opengl/qopenglextrafunctions.h - opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h + opengl/qopenglfunctions.cpp opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h rhi/qrhigles2.cpp rhi/qrhigles2_p.h rhi/qrhigles2_p_p.h diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index b99b08ca92..38ec93cf6f 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -51,7 +51,9 @@ #include #include "private/qwindow_p.h" #include "private/qcursor_p.h" -#include "private/qopenglcontext_p.h" +#if QT_CONFIG(opengl) +# include "private/qopenglcontext_p.h" +#endif #include "private/qinputdevicemanager_p.h" #include "private/qinputmethod_p.h" #include "private/qpointingdevice_p.h" diff --git a/src/gui/painting/qpathsimplifier.cpp b/src/gui/painting/qpathsimplifier.cpp index 6c061b2bb1..36baccd3e4 100644 --- a/src/gui/painting/qpathsimplifier.cpp +++ b/src/gui/painting/qpathsimplifier.cpp @@ -8,7 +8,9 @@ #include #include -#include +#if QT_CONFIG(opengl) +# include +#endif #include QT_BEGIN_NAMESPACE diff --git a/src/gui/platform/unix/qunixnativeinterface.cpp b/src/gui/platform/unix/qunixnativeinterface.cpp index 4ea88a590b..60a96932e6 100644 --- a/src/gui/platform/unix/qunixnativeinterface.cpp +++ b/src/gui/platform/unix/qunixnativeinterface.cpp @@ -3,7 +3,9 @@ #include -#include +#if QT_CONFIG(opengl) +# include +#endif #include #include