Skip to content

Commit

Permalink
tests: fix configuring with -no-feature-gui
Browse files Browse the repository at this point in the history
Pick-to: 6.2 6.4
Change-Id: I99765d38c9c37f1fe17b15f7736e4c78c7ffac20
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
JohannesKauffmann committed Oct 28, 2022
1 parent 5143670 commit a9fa999
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions tests/auto/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,12 @@ _qt_internal_test_expect_pass(test_json_plugin_includes)

if(NOT NO_GUI)
_qt_internal_test_expect_build_fail(test_testlib_no_link_gui)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/"
)
endif()

execute_process(COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/"
)

if (NOT NO_WIDGETS)
_qt_internal_test_expect_build_fail(test_testlib_no_link_widgets)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ add_subdirectory(qmetaobjectbuilder)
add_subdirectory(qmetamethod)
add_subdirectory(qmetaproperty)
add_subdirectory(qmetaenum)
add_subdirectory(qpointer)
add_subdirectory(qsignalblocker)
add_subdirectory(qsignalmapper)
add_subdirectory(qtimer)
Expand All @@ -29,6 +28,7 @@ endif()
if(TARGET Qt::Gui)
add_subdirectory(qmetatype)
add_subdirectory(qmimedata)
add_subdirectory(qpointer)
add_subdirectory(qvariant)
endif()
if(TARGET Qt::Network AND NOT ANDROID AND NOT UIKIT)
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/corelib/serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ endif()
if(TARGET Qt::Network)
add_subdirectory(qtextstream)
endif()
if(TARGET Qt::Network AND TARGET Qt::Xml AND NOT INTEGRITY AND NOT QNX)
if(TARGET Qt::Gui AND TARGET Qt::Network AND TARGET Qt::Xml AND NOT INTEGRITY AND NOT QNX)
add_subdirectory(qxmlstream)
endif()
3 changes: 2 additions & 1 deletion tests/auto/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ if(TARGET Qt::DBus)
add_subdirectory(qdbuscpp2xml)
add_subdirectory(qdbusxml2cpp)
endif()
if(QT_FEATURE_process AND NOT CMAKE_CROSSCOMPILING)
if(TARGET Qt::Gui AND QT_FEATURE_process AND NOT CMAKE_CROSSCOMPILING)
# testapp (windeployqt) and source_basicapp (macdeployqt) require QtGui.
if(QT_FEATURE_macdeployqt)
add_subdirectory(macdeployqt)
endif()
Expand Down
2 changes: 1 addition & 1 deletion tests/baseline/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

if(TARGET Qt::Network)
if(TARGET Qt::Gui AND TARGET Qt::Network)
add_subdirectory(painting)
endif()
if(TARGET Qt::Network AND TARGET Qt::Widgets)
Expand Down
5 changes: 2 additions & 3 deletions tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ qt_internal_add_benchmark(tst_bench_qvariant
SOURCES
tst_bench_qvariant.cpp
LIBRARIES
Qt::Gui
Qt::Test
)

## Scopes:
#####################################################################

qt_internal_extend_target(tst_bench_qvariant CONDITION NOT TARGET Qt::Gui
qt_internal_extend_target(tst_bench_qvariant CONDITION TARGET Qt::Gui
LIBRARIES
# Remove: gui
Qt::Gui
)

0 comments on commit a9fa999

Please sign in to comment.