Fix cmake module_includes and test_opengl_lib tests when no_opengl

Fixes: QTBUG-126350
Fixes: QTBUG-126351
Change-Id: Ic241e15b45090c69d24efe58c03df91ea8c1d298
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 6899008daab3ec31af4871d3b5063b99296e89fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Jukka Jokiniva 2024-07-31 12:23:53 +03:00 committed by Qt Cherry-pick Bot
parent 9f56f88c02
commit 68b07f90f9
2 changed files with 13 additions and 2 deletions

View File

@ -116,6 +116,9 @@ function(_qt_internal_get_cmake_test_configure_options out_var)
if (NO_WIDGETS) if (NO_WIDGETS)
list(APPEND option_list "-DNO_WIDGETS=True") list(APPEND option_list "-DNO_WIDGETS=True")
endif() endif()
if (NO_OPENGL)
list(APPEND option_list "-DNO_OPENGL=True")
endif()
if (NO_DBUS) if (NO_DBUS)
list(APPEND option_list "-DNO_DBUS=True") list(APPEND option_list "-DNO_DBUS=True")
endif() endif()

View File

@ -109,6 +109,9 @@ endif()
if(NOT TARGET Qt::Widgets) if(NOT TARGET Qt::Widgets)
set(NO_WIDGETS TRUE) set(NO_WIDGETS TRUE)
endif() endif()
if(NOT TARGET Qt::OpenGL)
set(NO_OPENGL TRUE)
endif()
include("${_Qt6CTestMacros}") include("${_Qt6CTestMacros}")
@ -282,11 +285,16 @@ endif()
if (NOT NO_WIDGETS) if (NOT NO_WIDGETS)
list(APPEND qt_module_includes list(APPEND qt_module_includes
Widgets QWidget Widgets QWidget
OpenGL QOpenGLBuffer
PrintSupport QPrinter PrintSupport QPrinter
) )
endif() endif()
if (NOT NO_OPENGL)
list(APPEND qt_module_includes
OpenGL QOpenGLBuffer
)
endif()
if (NOT NO_DBUS) if (NOT NO_DBUS)
list(APPEND qt_module_includes list(APPEND qt_module_includes
DBus QDBusMessage DBus QDBusMessage
@ -298,7 +306,7 @@ _qt_internal_test_module_includes(
) )
_qt_internal_test_expect_pass(test_concurrent_module) _qt_internal_test_expect_pass(test_concurrent_module)
if(NOT NO_GUI) if(NOT NO_GUI AND NOT NO_OPENGL)
_qt_internal_test_expect_pass(test_opengl_lib) _qt_internal_test_expect_pass(test_opengl_lib)
endif() endif()