CMake: Add NO_COMPILER_RUNTIME to deploy script macros

Provides the NO_COMPILER_RUNTIME boolean option to
qt_deploy_runtime_dependencies() and qt_generate_deploy_app_script().

In both cases this results in using the "--no-compiler-runtime" option
of windeployqt.

The value has no effect on other platforms.

[ChangeLog][CMake] Added the option NO_COMPILER_RUNTIME to
qt_generate_deploy_app_script.

Task-number: QTBUG-111741
Pick-to: 6.5 6.5.0
Change-Id: I2e86f0959c4e1ae47b247667ace88d07e2f22271
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Christian Heimlich 2023-03-08 17:22:09 -05:00
parent 24da05f68d
commit e7b8b7bfbe
4 changed files with 16 additions and 0 deletions

View File

@ -287,6 +287,7 @@ function(qt6_deploy_runtime_dependencies)
NO_OVERWRITE NO_OVERWRITE
NO_APP_STORE_COMPLIANCE # TODO: Might want a better name NO_APP_STORE_COMPLIANCE # TODO: Might want a better name
NO_TRANSLATIONS NO_TRANSLATIONS
NO_COMPILER_RUNTIME
) )
set(single_value_options set(single_value_options
EXECUTABLE EXECUTABLE
@ -399,6 +400,9 @@ function(qt6_deploy_runtime_dependencies)
if(arg_NO_TRANSLATIONS) if(arg_NO_TRANSLATIONS)
list(APPEND tool_options --no-translations) list(APPEND tool_options --no-translations)
endif() endif()
if(arg_NO_COMPILER_RUNTIME)
list(APPEND tool_options --no-compiler-runtime)
endif()
elseif(__QT_DEPLOY_SYSTEM_NAME STREQUAL Darwin) elseif(__QT_DEPLOY_SYSTEM_NAME STREQUAL Darwin)
set(extra_binaries_option "-executable=") set(extra_binaries_option "-executable=")
if(NOT arg_NO_APP_STORE_COMPLIANCE) if(NOT arg_NO_APP_STORE_COMPLIANCE)

View File

@ -2977,6 +2977,7 @@ function(qt6_generate_deploy_app_script)
# mutually exclusive with the TARGET keyword. # mutually exclusive with the TARGET keyword.
set(no_value_options set(no_value_options
NO_TRANSLATIONS NO_TRANSLATIONS
NO_COMPILER_RUNTIME
NO_UNSUPPORTED_PLATFORM_ERROR NO_UNSUPPORTED_PLATFORM_ERROR
) )
set(single_value_options set(single_value_options
@ -3043,6 +3044,9 @@ function(qt6_generate_deploy_app_script)
if(arg_NO_TRANSLATIONS) if(arg_NO_TRANSLATIONS)
string(APPEND common_deploy_args " NO_TRANSLATIONS\n") string(APPEND common_deploy_args " NO_TRANSLATIONS\n")
endif() endif()
if(arg_NO_COMPILER_RUNTIME)
string(APPEND common_deploy_args " NO_COMPILER_RUNTIME\n")
endif()
# Forward the arguments that are exactly the same for qt_deploy_runtime_dependencies. # Forward the arguments that are exactly the same for qt_deploy_runtime_dependencies.
foreach(var IN LISTS qt_deploy_runtime_dependencies_options) foreach(var IN LISTS qt_deploy_runtime_dependencies_options)

View File

@ -38,6 +38,7 @@ qt_deploy_runtime_dependencies(
[NO_OVERWRITE] [NO_OVERWRITE]
[NO_APP_STORE_COMPLIANCE] [NO_APP_STORE_COMPLIANCE]
[NO_TRANSLATIONS] [NO_TRANSLATIONS]
[NO_COMPILER_RUNTIME]
[PRE_INCLUDE_REGEXES regexes...] [PRE_INCLUDE_REGEXES regexes...]
[PRE_EXCLUDE_REGEXES regexes...] [PRE_EXCLUDE_REGEXES regexes...]
[POST_INCLUDE_REGEXES regexes...] [POST_INCLUDE_REGEXES regexes...]
@ -124,6 +125,9 @@ inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use
\l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations \l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations
in a customized way. in a customized way.
For Windows desktop applications, the required runtime files for the compiler
are also installed by default. To prevent this, specify \c{NO_COMPILER_RUNTIME}.
On Linux, deploying runtime dependencies is based on CMake's On Linux, deploying runtime dependencies is based on CMake's
\c{file(GET_RUNTIME_DEPENDENCIES)} command. The options \c{PRE_INCLUDE_REGEXES}, \c{file(GET_RUNTIME_DEPENDENCIES)} command. The options \c{PRE_INCLUDE_REGEXES},
\c{PRE_EXCLUDE_REGEXES}, \c{POST_INCLUDE_REGEXES}, \c{POST_EXCLUDE_REGEXES}, \c{PRE_EXCLUDE_REGEXES}, \c{POST_INCLUDE_REGEXES}, \c{POST_EXCLUDE_REGEXES},

View File

@ -22,6 +22,7 @@ qt_generate_deploy_app_script(
TARGET target TARGET target
OUTPUT_SCRIPT <var> OUTPUT_SCRIPT <var>
[NO_TRANSLATIONS] [NO_TRANSLATIONS]
[NO_COMPILER_RUNTIME]
[NO_UNSUPPORTED_PLATFORM_ERROR] [NO_UNSUPPORTED_PLATFORM_ERROR]
[PRE_INCLUDE_REGEXES regexes...] [PRE_INCLUDE_REGEXES regexes...]
[PRE_EXCLUDE_REGEXES regexes...] [PRE_EXCLUDE_REGEXES regexes...]
@ -70,6 +71,9 @@ inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use
\l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations in a \l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations in a
customized way. customized way.
For Windows desktop applications, the required runtime files for the compiler
are also installed by default. To prevent this, specify \c{NO_COMPILER_RUNTIME}.
For deploying a QML application, use For deploying a QML application, use
\l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()} \l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}
instead. instead.