CMake: Add a way to turn off plugin deployment
[ChangeLog][CMake] Add the NO_PLUGINS argument to qt_deploy_runtime_dependencies. This turns off plugin deployment altogether. For Linux, support for NO_PLUGINS is added in a subsequent patch. Change-Id: Ie822a287f677fdc524ba5b884115e290ea288e67 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
parent
696f9adaa4
commit
5766d74ee1
@ -183,6 +183,7 @@ endfunction()
|
|||||||
|
|
||||||
function(_qt_internal_generic_deployqt)
|
function(_qt_internal_generic_deployqt)
|
||||||
set(no_value_options
|
set(no_value_options
|
||||||
|
NO_PLUGINS
|
||||||
NO_TRANSLATIONS
|
NO_TRANSLATIONS
|
||||||
VERBOSE
|
VERBOSE
|
||||||
)
|
)
|
||||||
@ -209,6 +210,12 @@ function(_qt_internal_generic_deployqt)
|
|||||||
message(FATAL_ERROR "Unparsed arguments: ${arg_UNPARSED_ARGUMENTS}")
|
message(FATAL_ERROR "Unparsed arguments: ${arg_UNPARSED_ARGUMENTS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(arg_NO_PLUGINS)
|
||||||
|
set(plugins "")
|
||||||
|
else()
|
||||||
|
set(plugins ${__QT_DEPLOY_PLUGINS})
|
||||||
|
endif()
|
||||||
|
|
||||||
if(arg_VERBOSE OR __QT_DEPLOY_VERBOSE)
|
if(arg_VERBOSE OR __QT_DEPLOY_VERBOSE)
|
||||||
set(verbose TRUE)
|
set(verbose TRUE)
|
||||||
endif()
|
endif()
|
||||||
@ -225,7 +232,9 @@ function(_qt_internal_generic_deployqt)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# We need to get the runtime dependencies of plugins too.
|
# We need to get the runtime dependencies of plugins too.
|
||||||
list(APPEND arg_MODULES ${__QT_DEPLOY_PLUGINS})
|
if(NOT plugins STREQUAL "")
|
||||||
|
list(APPEND arg_MODULES ${plugins})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Forward the arguments that are exactly the same for file(GET_RUNTIME_DEPENDENCIES).
|
# Forward the arguments that are exactly the same for file(GET_RUNTIME_DEPENDENCIES).
|
||||||
set(file_GRD_args "")
|
set(file_GRD_args "")
|
||||||
@ -280,7 +289,7 @@ function(_qt_internal_generic_deployqt)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Deploy the Qt plugins.
|
# Deploy the Qt plugins.
|
||||||
foreach(file_path IN LISTS __QT_DEPLOY_PLUGINS)
|
foreach(file_path IN LISTS plugins)
|
||||||
file(RELATIVE_PATH destination
|
file(RELATIVE_PATH destination
|
||||||
"${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_PLUGINS}"
|
"${__QT_DEPLOY_QT_INSTALL_PREFIX}/${__QT_DEPLOY_QT_INSTALL_PLUGINS}"
|
||||||
"${file_path}"
|
"${file_path}"
|
||||||
@ -326,6 +335,7 @@ function(qt6_deploy_runtime_dependencies)
|
|||||||
VERBOSE
|
VERBOSE
|
||||||
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_PLUGINS
|
||||||
NO_TRANSLATIONS
|
NO_TRANSLATIONS
|
||||||
NO_COMPILER_RUNTIME
|
NO_COMPILER_RUNTIME
|
||||||
)
|
)
|
||||||
@ -450,6 +460,9 @@ function(qt6_deploy_runtime_dependencies)
|
|||||||
if(arg_NO_COMPILER_RUNTIME)
|
if(arg_NO_COMPILER_RUNTIME)
|
||||||
list(APPEND tool_options --no-compiler-runtime)
|
list(APPEND tool_options --no-compiler-runtime)
|
||||||
endif()
|
endif()
|
||||||
|
if(arg_NO_PLUGINS)
|
||||||
|
list(APPEND tool_options --no-plugins)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Specify path to target Qt's qtpaths .exe or .bat file, so windeployqt deploys the correct
|
# Specify path to target Qt's qtpaths .exe or .bat file, so windeployqt deploys the correct
|
||||||
# libraries when cross-compiling from x86_64 to arm64 windows.
|
# libraries when cross-compiling from x86_64 to arm64 windows.
|
||||||
@ -465,6 +478,9 @@ function(qt6_deploy_runtime_dependencies)
|
|||||||
list(APPEND tool_options ${arg_DEPLOY_TOOL_OPTIONS})
|
list(APPEND tool_options ${arg_DEPLOY_TOOL_OPTIONS})
|
||||||
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(arg_NO_PLUGINS)
|
||||||
|
list(APPEND tool_options -no-plugins)
|
||||||
|
endif()
|
||||||
if(NOT arg_NO_APP_STORE_COMPLIANCE)
|
if(NOT arg_NO_APP_STORE_COMPLIANCE)
|
||||||
list(APPEND tool_options -appstore-compliant)
|
list(APPEND tool_options -appstore-compliant)
|
||||||
endif()
|
endif()
|
||||||
@ -507,6 +523,9 @@ function(qt6_deploy_runtime_dependencies)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
if(arg_NO_PLUGINS)
|
||||||
|
list(APPEND tool_options NO_PLUGINS)
|
||||||
|
endif()
|
||||||
if(arg_NO_TRANSLATIONS)
|
if(arg_NO_TRANSLATIONS)
|
||||||
list(APPEND tool_options NO_TRANSLATIONS)
|
list(APPEND tool_options NO_TRANSLATIONS)
|
||||||
endif()
|
endif()
|
||||||
|
@ -38,6 +38,7 @@ qt_deploy_runtime_dependencies(
|
|||||||
[VERBOSE]
|
[VERBOSE]
|
||||||
[NO_OVERWRITE]
|
[NO_OVERWRITE]
|
||||||
[NO_APP_STORE_COMPLIANCE]
|
[NO_APP_STORE_COMPLIANCE]
|
||||||
|
[NO_PLUGINS] # since Qt 6.10
|
||||||
[NO_TRANSLATIONS]
|
[NO_TRANSLATIONS]
|
||||||
[NO_COMPILER_RUNTIME]
|
[NO_COMPILER_RUNTIME]
|
||||||
[DEPLOY_TOOL_OPTIONS]
|
[DEPLOY_TOOL_OPTIONS]
|
||||||
@ -184,6 +185,12 @@ The default value of \c{POST_EXCLUDE_REGEXES} is constructed from the value of
|
|||||||
{qt6_deploy_qt_conf}{qt_deploy_qt_conf()},
|
{qt6_deploy_qt_conf}{qt_deploy_qt_conf()},
|
||||||
{qt6_deploy_qml_imports}{qt_deploy_qml_imports()}
|
{qt6_deploy_qml_imports}{qt_deploy_qml_imports()}
|
||||||
|
|
||||||
|
\section1 Controlling deployment of Qt plugins
|
||||||
|
|
||||||
|
Qt plugins are automatically deployed into \l QT_DEPLOY_PLUGINS_DIR.
|
||||||
|
|
||||||
|
You can turn off plugin deployment with the \c NO_PLUGINS argument.
|
||||||
|
|
||||||
\section1 Example
|
\section1 Example
|
||||||
|
|
||||||
The following example shows how to deploy an application \c{MyApp}.
|
The following example shows how to deploy an application \c{MyApp}.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user