qt_enable_separate_debug_info: Enable custom location of dSYM directory

It is part of a solution to produce notarizable binaries for
application using Qt WebEngine.

Pick-to: 6.6 6.5
Task-number: QTBUG-99555
Change-Id: Ice0bbcfb12829906328f55158b0c37f03878f17c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Michael Brüning 2023-07-27 16:45:07 +02:00
parent ee43dacbea
commit ebb361ee3f

View File

@ -201,7 +201,11 @@ endfunction()
# Enable separate debug information for the given target # Enable separate debug information for the given target
function(qt_enable_separate_debug_info target installDestination) function(qt_enable_separate_debug_info target installDestination)
set(flags QT_EXECUTABLE) set(flags QT_EXECUTABLE)
set(options) if(APPLE)
set(options DSYM_OUTPUT_DIR)
else()
set(options)
endif()
set(multiopts ADDITIONAL_INSTALL_ARGS) set(multiopts ADDITIONAL_INSTALL_ARGS)
cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN})
@ -248,12 +252,20 @@ function(qt_enable_separate_debug_info target installDestination)
get_target_property(is_framework ${target} FRAMEWORK) get_target_property(is_framework ${target} FRAMEWORK)
if(is_framework) if(is_framework)
qt_internal_get_framework_info(fw ${target}) qt_internal_get_framework_info(fw ${target})
set(debug_info_bundle_dir "$<TARGET_BUNDLE_DIR:${target}>.${debug_info_suffix}")
set(BUNDLE_ID ${fw_name}) set(BUNDLE_ID ${fw_name})
else() else()
set(debug_info_bundle_dir "$<TARGET_FILE:${target}>.${debug_info_suffix}")
set(BUNDLE_ID ${target}) set(BUNDLE_ID ${target})
endif() endif()
if (NOT "x${arg_DSYM_OUTPUT_DIR}" STREQUAL "x")
set(debug_info_bundle_dir "${arg_DSYM_OUTPUT_DIR}/${target}")
elseif(is_framework)
set(debug_info_bundle_dir "$<TARGET_BUNDLE_DIR:${target}>")
else()
set(debug_info_bundle_dir "$<TARGET_FILE:${target}>")
endif()
set(debug_info_bundle_dir "${debug_info_bundle_dir}.${debug_info_suffix}")
set(debug_info_contents_dir "${debug_info_bundle_dir}/Contents") set(debug_info_contents_dir "${debug_info_bundle_dir}/Contents")
set(debug_info_target_dir "${debug_info_contents_dir}/Resources/DWARF") set(debug_info_target_dir "${debug_info_contents_dir}/Resources/DWARF")
configure_file( configure_file(