summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-02-08 12:48:57 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-09 14:10:41 (GMT)
commit9e87df4d468fb8d3a835cbdfeca30fee9586e00d (patch)
tree47cbf7686661af362b30c39673a4f6cfc37f66c1 /Tests
parentc673511263822c688fa302120a29e1e0cf812c0b (diff)
downloadCMake-9e87df4d468fb8d3a835cbdfeca30fee9586e00d.zip
CMake-9e87df4d468fb8d3a835cbdfeca30fee9586e00d.tar.gz
CMake-9e87df4d468fb8d3a835cbdfeca30fee9586e00d.tar.bz2
Autogen/RCC: Disable zstd if it is not supported
Add the `--no-zstd` argument for `RCC` when `QT_FEATURE_zstd` is `OFF`. This causes user project builds to fail. That bug is fixed in Qt by https://codereview.qt-project.org/c/qt/qtbase/+/537546 but for the older versions, fix it here too. Fixes: #25664
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Autogen/RccExample.cmake4
-rw-r--r--Tests/RunCMake/Autogen/RunCMakeTest.cmake21
2 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/Autogen/RccExample.cmake b/Tests/RunCMake/Autogen/RccExample.cmake
index 4554eb0..ade0fef 100644
--- a/Tests/RunCMake/Autogen/RccExample.cmake
+++ b/Tests/RunCMake/Autogen/RccExample.cmake
@@ -9,3 +9,7 @@ target_link_libraries(dummy Qt${with_qt_version}::Core
Qt${with_qt_version}::Gui)
set_target_properties(dummy PROPERTIES AUTORCC ON)
+
+if(DEFINED ZSTD_VALUE)
+ set(QT_FEATURE_zstd ${ZSTD_VALUE})
+endif()
diff --git a/Tests/RunCMake/Autogen/RunCMakeTest.cmake b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
index d0bbbb0..0036551 100644
--- a/Tests/RunCMake/Autogen/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
@@ -463,4 +463,25 @@ ${make_program_stderr}
endblock()
endforeach()
endif()
+
+ if (QtCore_VERSION VERSION_GREATER_EQUAL 6)
+ if (RunCMake_GENERATOR MATCHES "Make|Ninja")
+ foreach(value IN ITEMS ON OFF)
+ block()
+ set(RunCMake_TEST_BINARY_DIR
+ ${RunCMake_BINARY_DIR}/RccNoZTSD-${value}-build)
+ run_cmake_with_options(RccExample ${RunCMake_TEST_OPTIONS}
+ -DCMAKE_AUTOGEN_VERBOSE=ON -DZSTD_VALUE=${value})
+ if (value STREQUAL "OFF")
+ set(RunCMake_TEST_EXPECT_stdout "--no-zstd")
+ else()
+ set(RunCMake_TEST_NOT_EXPECT_stdout "--no-zstd")
+ endif()
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(RccNoZTSD-${value}-build ${CMAKE_COMMAND}
+ --build . --config Debug)
+ endblock()
+ endforeach()
+ endif()
+ endif()
endif ()