diff options
author | Cristian Adam <cristian.adam@qt.io> | 2020-11-02 12:40:57 +0100 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2020-11-04 01:41:06 +0100 |
commit | 68f3e37449223466723a1ebc5b4f712634f993ac (patch) | |
tree | e74e4b42139499882c61de4832f086bf7569bc75 /cmake/QtSeparateDebugInfo.cmake | |
parent | f6418343f1f8c08654f30191c1d8059761a016eb (diff) |
CMake Build: Enable separate debug info for all target types
Now all shared libraries and executables will get .debug files on
the platforms that support FEATURE_separate_debug_info
With the directory property _qt_skip_separate_debug_info certain
targets can retain the debug symbols in the binary e.g. lupdate with
MinGW 8.1.0 will cause objcopy / strip to fail.
Fixes: QTBUG-87015
Change-Id: I03b106e68ef0a42011d1ba641e6f686b2e7b7fb4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtSeparateDebugInfo.cmake')
-rw-r--r-- | cmake/QtSeparateDebugInfo.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/QtSeparateDebugInfo.cmake b/cmake/QtSeparateDebugInfo.cmake index d2c976f164..25c6debf7c 100644 --- a/cmake/QtSeparateDebugInfo.cmake +++ b/cmake/QtSeparateDebugInfo.cmake @@ -6,6 +6,24 @@ endif() # Enable separate debug information for the given target function(qt_enable_separate_debug_info target installDestination) + if (NOT QT_FEATURE_separate_debug_info) + return() + endif() + if (NOT UNIX AND NOT MINGW) + return() + endif() + get_target_property(target_type ${target} TYPE) + if (NOT target_type STREQUAL "MODULE_LIBRARY" AND + NOT target_type STREQUAL "SHARED_LIBRARY" AND + NOT target_type STREQUAL "EXECUTABLE") + return() + endif() + get_property(target_source_dir TARGET ${target} PROPERTY SOURCE_DIR) + get_property(skip_separate_debug_info DIRECTORY "${target_source_dir}" PROPERTY _qt_skip_separate_debug_info) + if (skip_separate_debug_info) + return() + endif() + unset(commands) if(APPLE) find_program(DSYMUTIL_PROGRAM dsymutil) |