diff options
-rw-r--r-- | cmake/QtFlagHandlingHelpers.cmake | 16 | ||||
-rw-r--r-- | cmake/QtPostProcessHelpers.cmake | 5 | ||||
-rw-r--r-- | cmake/QtProcessConfigureArgs.cmake | 10 | ||||
-rw-r--r-- | cmake/configure-cmake-mapping.md | 1 | ||||
-rw-r--r-- | config_help.txt | 10 |
5 files changed, 36 insertions, 6 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index fe9e0e072a..708496fb85 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -183,13 +183,17 @@ function(qt_internal_library_deprecation_level result) # QT_DISABLE_DEPRECATED_UP_TO controls which version we use as a cut-off # compiling in to the library. E.g. if it is set to QT_VERSION then no # code which was deprecated before QT_VERSION will be compiled in. - if(WIN32) - # On Windows, due to the way DLLs work, we need to export all functions, - # including the inlines - list(APPEND deprecations "QT_DISABLE_DEPRECATED_UP_TO=0x040800") + if (NOT DEFINED QT_DISABLE_DEPRECATED_UP_TO) + if(WIN32) + # On Windows, due to the way DLLs work, we need to export all functions, + # including the inlines + list(APPEND deprecations "QT_DISABLE_DEPRECATED_UP_TO=0x040800") + else() + # On other platforms, Qt's own compilation does need to compile the Qt 5.0 API + list(APPEND deprecations "QT_DISABLE_DEPRECATED_UP_TO=0x050000") + endif() else() - # On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API - list(APPEND deprecations "QT_DISABLE_DEPRECATED_UP_TO=0x050000") + list(APPEND deprecations "QT_DISABLE_DEPRECATED_UP_TO=${QT_DISABLE_DEPRECATED_UP_TO}") endif() # QT_WARN_DEPRECATED_UP_TO controls the upper-bound of deprecation # warnings that are emitted. E.g. if it is set to 0x060500 then all use of diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index ddaa2915f4..d334741ecd 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -685,6 +685,11 @@ endif()\n") string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "set(QT_EXTRA_RPATHS \"${QT_EXTRA_RPATHS}\" CACHE STRING \"\")\n") endif() + if(DEFINED QT_DISABLE_DEPRECATED_UP_TO) + string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS + "set(QT_DISABLE_DEPRECATED_UP_TO \"${QT_DISABLE_DEPRECATED_UP_TO}\"" + " CACHE STRING \"\")\n") + endif() # Save pkg-config feature value to be able to query it internally as soon as BuildInternals # package is loaded. This is to avoid any pkg-config package from being found when 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}") diff --git a/cmake/configure-cmake-mapping.md b/cmake/configure-cmake-mapping.md index 1282c0d484..ade65ed5de 100644 --- a/cmake/configure-cmake-mapping.md +++ b/cmake/configure-cmake-mapping.md @@ -169,3 +169,4 @@ The following table describes the mapping of configure options to CMake argument | -libjpeg | -DFEATURE_libjpeg=ON | | | -sql-<driver> | -DFEATURE_sql_<driver>=ON | | | -sqlite [qt/system] | -DFEATURE_system_sqlite=OFF/ON | | +| -disable-deprecated-up-to <hex_version> | -DQT_DISABLE_DEPRECATED_UP_TO=<hex_version> | | diff --git a/config_help.txt b/config_help.txt index bd229c43a4..a02d60e5ce 100644 --- a/config_help.txt +++ b/config_help.txt @@ -141,6 +141,16 @@ Build options: -warnings-are-errors . Treat warnings as errors [no; yes if -developer-build] + -disable-deprecated-up-to <version> + Set the QT_DISABLE_DEPRECATED_UP_TO value to <version>. + QT_DISABLE_DEPRECATED_UP_TO is used to remove + deprecated methods from both API and ABI. + <version> is a hex value, for example 0x060500 can be + used to remove all code deprecated in Qt 6.5.0 or + earlier releases. + By default <version> is set to 0x040000 and 0x050000 on + Windows, and non-Windows respectively. + Build environment: -sysroot <dir> ....... Set <dir> as the target sysroot |