CMake by default uses the Release configuration for the Xcode archiving task, providing no way to choose a different configuration. CMake also sets the "generate debugging symbols" Xcode option aka the -g flag to NO for the Release config, because it is not the RelWithDebInfo config. This means that by default the archived project will never have debugging symbols. Change the GCC_GENERATE_DEBUGGING_SYMBOLS Xcode attribute to YES for all the release configs (Release, MinSizeRel, RelWithDebInfo), as well as the debug config. This matches the defaults of a project created in Xcode directly and ensures debug symbols are generated for all configs. Another issue is that the Xcode project generated by CMake shows no values for the debugging format option, which is controlled by the DEBUG_INFORMATION_FORMAT attribute. In contrast a project created in Xcode directly, sets the Debug config format to "dwarf" and the Release config format to "dwarf-with-dsym". This prevents inclusion of the dSYMs into the archive, because the dSYM would not be created in the first place. Override the DEBUG_INFORMATION_FORMAT per-config. The release configs get the 'dwarf-with-dsym' variant, while the debug config will have 'dwarf'. This matches the values of a new project created directly in Xcode. Each of these assignments can be opted out by setting one of the following variables: - QT_NO_SET_XCODE_DEBUG_INFORMATION_FORMAT - QT_NO_SET_XCODE_GCC_GENERATE_DEBUGGING_SYMBOLS These changes improve the defaults for a CMake generated Xcode project, but are not sufficient to ensure that dSYMs are included into the archive created by the Xcode archiving task. For that, the project also needs to set the CONFIGURATION_BUILD_DIR attribute to '$(inherited)' to avoid a bug in Xcode, where it can't copy dSYMs out of a non-inherited build dir into the archive. Qt can't do that unconditionally, because it violates CMake's build path preconditions, resulting in things like $<TARGET_FILE:app> genex evaluation not working, as well as ignoring of the CMAKE_RUNTIME_OUTPUT_DIRECTORY property. A follow up change will provide an opt-in to do that, but only at the project developer's own risk. [ChangeLog][CMake] CMake-generated Xcode projects will now include debugging symbols by default, regardless of configuration type, and Release-like configurations will default to using dSYM bundles instead of keeping the debug symbols in object files, to match Xcode project defaults. Pick-to: 6.7 Task-number: QTBUG-126866 Change-Id: Ie17b40e53ba22658a098f9a162c7bcfb1711c45b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 7ccf30ae46272ace13bedc33ccf5f116ff57091b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%