summaryrefslogtreecommitdiffstats
path: root/cmake/QtExecutableHelpers.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2024-11-14 15:12:58 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2024-11-14 18:28:32 +0100
commitaa06c8dbfa0fc4bf573ef7be7706a76d812bae55 (patch)
treebade593f6089623b82e056274d1ec63dd098e034 /cmake/QtExecutableHelpers.cmake
parent59039f42d863815556a9de05a452f8802c727582 (diff)
CMake: Move separate debug info handling to an executable finalizer
Currently the separate debug info handling is done inside the call of qt_internal_add_executable. But there might be extra properties set after the executable is created, which we might want to consider when handling the separate debug info, like whether the executable is a macOS bundle. Introduce a new qt_internal_finalize_executable finalizer. Move the separate debug info handler to be called in this finalizer. To be consistent run the separate debug info handler in a finalizer for qt tools as well. Pick-to: 6.8 Change-Id: I46412249aaab099628a50b11efff541f5719aff5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtExecutableHelpers.cmake')
-rw-r--r--cmake/QtExecutableHelpers.cmake17
1 files changed, 14 insertions, 3 deletions
diff --git a/cmake/QtExecutableHelpers.cmake b/cmake/QtExecutableHelpers.cmake
index 05b3603e048..4c96c811e96 100644
--- a/cmake/QtExecutableHelpers.cmake
+++ b/cmake/QtExecutableHelpers.cmake
@@ -242,9 +242,13 @@ function(qt_internal_add_executable name)
else()
unset(separate_debug_info_executable_arg)
endif()
- qt_enable_separate_debug_info(${name} "${arg_INSTALL_DIRECTORY}"
- ${separate_debug_info_executable_arg}
- ADDITIONAL_INSTALL_ARGS ${additional_install_args})
+
+ qt_internal_defer_separate_debug_info("${name}"
+ SEPARATE_DEBUG_INFO_ARGS
+ "${arg_INSTALL_DIRECTORY}"
+ ${separate_debug_info_executable_arg}
+ ADDITIONAL_INSTALL_ARGS ${additional_install_args}
+ )
qt_internal_install_pdb_files(${name} "${arg_INSTALL_DIRECTORY}")
endif()
@@ -264,6 +268,13 @@ function(qt_internal_add_executable name)
_qt_internal_extend_sbom(${name} ${sbom_args})
endif()
+
+ qt_add_list_file_finalizer(qt_internal_finalize_executable "${name}")
+endfunction()
+
+# Finalizer for all generic internal executables.
+function(qt_internal_finalize_executable target)
+ qt_internal_finalize_executable_separate_debug_info("${target}")
endfunction()
# This function compiles the target at configure time the very first time and creates the custom