diff options
author | Martin Vejdarski <martin@scenegroup.co> | 2021-07-12 20:27:22 +0300 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-17 02:55:12 +0200 |
commit | 3c148323c08cff1487211c18beda90ae2c6ef508 (patch) | |
tree | 85d5fde3f4da2748eb311d04fc7aac28e06219d1 /cmake/QtSeparateDebugInfo.cmake | |
parent | 48fa7f53cc36cf660a9c9a504239eaa99939756b (diff) |
CMake: Exclude dSYM INSTALL commands for already excluded tools in debug
Debug tools are excluded from the ALL target for debug_and_release
builds. However, when using the -separate-debug-info option, the same
exclusion wasn't being applied for their dSYM INSTALL commands,
resulting in a CMake install error.
Pass any additional install args like
EXCLUDE_FROM_ALL COMPONENT "ExcludedExecutables"
to the installation rules of qt_enable_separate_debug_info and
install dSYMs for executables per-config in a multi-config build.
All the non-main config executable install rules are optional because
the non-main config executables are excluded from ALL.
Amends 5b136abd21803988f96b9b66c992822efbef97ec
Pick-to: 6.2
Fixes: QTBUG-93999
Change-Id: I95c3ce28215c3ee535551e4b7a5fa9731f8f1c28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtSeparateDebugInfo.cmake')
-rw-r--r-- | cmake/QtSeparateDebugInfo.cmake | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/cmake/QtSeparateDebugInfo.cmake b/cmake/QtSeparateDebugInfo.cmake index c31d618d00..00ac4519fe 100644 --- a/cmake/QtSeparateDebugInfo.cmake +++ b/cmake/QtSeparateDebugInfo.cmake @@ -6,6 +6,11 @@ endif() # Enable separate debug information for the given target function(qt_enable_separate_debug_info target installDestination) + set(flags QT_EXECUTABLE) + set(options) + set(multiopts ADDITIONAL_INSTALL_ARGS) + cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) + if (NOT QT_FEATURE_separate_debug_info) return() endif() @@ -66,7 +71,27 @@ function(qt_enable_separate_debug_info target installDestination) COMMAND ${CMAKE_COMMAND} -E copy "Info.dSYM.plist" "${debug_info_contents_dir}/Info.plist" ) set(debug_info_target "${debug_info_target_dir}/$<TARGET_FILE_BASE_NAME:${target}>") - qt_install(DIRECTORY ${debug_info_bundle_dir} DESTINATION ${installDestination}) + + if(arg_QT_EXECUTABLE AND QT_FEATURE_debug_and_release) + qt_get_cmake_configurations(cmake_configs) + foreach(cmake_config ${cmake_configs}) + # Make installation optional for targets that are not built by default in this config + if(NOT (cmake_config STREQUAL QT_MULTI_CONFIG_FIRST_CONFIG)) + set(install_optional_arg OPTIONAL) + else() + unset(install_optional_arg) + endif() + qt_install(DIRECTORY ${debug_info_bundle_dir} + ${arg_ADDITIONAL_INSTALL_ARGS} + ${install_optional_arg} + CONFIGURATIONS ${cmake_config} + DESTINATION ${installDestination}) + endforeach() + else() + qt_install(DIRECTORY ${debug_info_bundle_dir} + ${arg_ADDITIONAL_INSTALL_ARGS} + DESTINATION ${installDestination}) + endif() else() set(debug_info_target "$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_BASE_NAME:${target}>.${debug_info_suffix}") qt_install(FILES ${debug_info_target} DESTINATION ${installDestination}) |