summaryrefslogtreecommitdiffstats
path: root/cmake/QtProcessConfigureArgs.cmake
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-08-16 13:02:27 +0200
committerIvan Solovev <ivan.solovev@qt.io>2022-08-19 23:52:05 +0200
commit2625a3a01ae56cfbfb097e40334d159ee262a6f6 (patch)
tree885fe1d240f6a9a9a6665a1e42570c6f6fbbe76a /cmake/QtProcessConfigureArgs.cmake
parent18f0484a0ed9785efe5acb4671695772e5715075 (diff)
Add -disable-deprecated-up-to parameter to configure script
And also teach CMake to treat it properly instead of hardcoding the version number. [ChangeLog][Build System] The configure script now accepts a new parameter -disable-deprecated-up-to which is used to remove all deprecated code from API and ABI while building the libraries. The version number must be specified in a hex format. For example, it can be used like this: /path/to/qt/configure -disable-deprecated-up-to 0x060500 to remove all code deprecated in Qt 6.5.0 or earlier releases. Task-number: QTBUG-101510 Change-Id: I557cf83e29b867fa1052bb097985e144b5eaf34d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtProcessConfigureArgs.cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index b58504919a..0830bd8977 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -43,6 +43,12 @@ function(warn_in_per_repo_build arg)
endif()
endfunction()
+function(is_valid_qt_hex_version arg version)
+ if(NOT version MATCHES "^0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$")
+ message(FATAL_ERROR "Incorrect version ${version} specified for ${arg}")
+ endif()
+endfunction()
+
if("${MODULE_ROOT}" STREQUAL "")
# If MODULE_ROOT is not set, assume that we want to build qtbase or top-level.
get_filename_component(MODULE_ROOT ".." ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
@@ -125,6 +131,10 @@ while(NOT "${configure_args}" STREQUAL "")
set(cmake_file_api FALSE)
elseif(arg STREQUAL "-verbose")
list(APPEND cmake_args "--log-level=STATUS")
+ elseif(arg STREQUAL "-disable-deprecated-up-to")
+ list(POP_FRONT configure_args version)
+ is_valid_qt_hex_version("${arg}" "${version}")
+ push("-DQT_DISABLE_DEPRECATED_UP_TO=${version}")
elseif(arg STREQUAL "--")
# Everything after this argument will be passed to CMake verbatim.
list(APPEND cmake_args "${configure_args}")