2016-04-07 03:37:44 +00:00
|
|
|
have_target:!static:if(darwin|!isEmpty(QMAKE_OBJCOPY)) {
|
|
|
|
darwin {
|
|
|
|
debug_info_copy_bin = $$QMAKE_DSYMUTIL
|
|
|
|
debug_info_strip_bin = $$QMAKE_STRIP
|
|
|
|
debug_info_suffix = dSYM
|
|
|
|
debug_info_out = --flat -o
|
|
|
|
debug_info_strip = -S
|
2012-11-28 14:14:25 +00:00
|
|
|
} else {
|
2016-04-07 03:37:44 +00:00
|
|
|
debug_info_copy_bin = $$QMAKE_OBJCOPY
|
|
|
|
debug_info_strip_bin = $$QMAKE_OBJCOPY
|
|
|
|
qnx {
|
|
|
|
debug_info_suffix = sym
|
|
|
|
debug_info_keep = --keep-file-symbols
|
|
|
|
debug_info_strip = --strip-debug -R.ident
|
|
|
|
} else {
|
|
|
|
debug_info_suffix = debug
|
|
|
|
debug_info_keep = --only-keep-debug
|
|
|
|
debug_info_strip = --strip-debug
|
|
|
|
}
|
2012-11-28 14:14:25 +00:00
|
|
|
}
|
2015-03-12 11:33:18 +00:00
|
|
|
load(resolve_target)
|
2016-04-07 03:37:44 +00:00
|
|
|
debug_info_target = $$QMAKE_RESOLVED_TARGET
|
|
|
|
|
|
|
|
darwin {
|
|
|
|
!isEmpty(QMAKE_RESOLVED_BUNDLE) {
|
|
|
|
debug_info_target = $$QMAKE_RESOLVED_BUNDLE
|
|
|
|
CONFIG += any_bundle
|
|
|
|
}
|
|
|
|
|
2016-06-11 03:27:53 +00:00
|
|
|
debug_info_target_rel = $$section(debug_info_target, /, -1, -1)
|
|
|
|
|
|
|
|
debug_info_target_dir_suffix = .$$debug_info_suffix/Contents/Resources/DWARF
|
|
|
|
|
|
|
|
debug_info_target_dir = $${debug_info_target}$${debug_info_target_dir_suffix}
|
|
|
|
debug_info_target_dir_rel = $${debug_info_target_rel}$${debug_info_target_dir_suffix}
|
2016-04-07 03:37:44 +00:00
|
|
|
!isEmpty(QMAKE_RESOLVED_BUNDLE): \
|
|
|
|
QMAKE_TARGET_DEBUG_INFO = $$debug_info_target_dir/$$TARGET
|
|
|
|
else: \
|
|
|
|
QMAKE_TARGET_DEBUG_INFO = $$debug_info_target_dir/$$section(QMAKE_RESOLVED_TARGET, /, -1, -1)
|
|
|
|
|
|
|
|
if(any_bundle:!build_pass)|if(!any_bundle:if(build_pass|isEmpty(BUILDS))) {
|
|
|
|
equals(TEMPLATE, lib):lib_bundle:!isEmpty(QMAKE_FRAMEWORK_BUNDLE_NAME): \
|
|
|
|
BUNDLEIDENTIFIER = $$replace(QMAKE_FRAMEWORK_BUNDLE_NAME, \\.framework$, )
|
|
|
|
else: equals(TEMPLATE, app):app_bundle:!isEmpty(QMAKE_APPLICATION_BUNDLE_NAME): \
|
|
|
|
BUNDLEIDENTIFIER = $$replace(QMAKE_APPLICATION_BUNDLE_NAME, \\.app$, )
|
|
|
|
else: \
|
|
|
|
BUNDLEIDENTIFIER = $${TARGET}
|
|
|
|
|
|
|
|
!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
|
|
|
|
BUNDLEIDENTIFIER = $$replace(QMAKE_TARGET_BUNDLE_PREFIX, \\.$, ).$${BUNDLEIDENTIFIER}
|
|
|
|
else: \
|
|
|
|
BUNDLEIDENTIFIER = com.yourcompany.$${BUNDLEIDENTIFIER}
|
|
|
|
|
|
|
|
BUNDLEIDENTIFIER ~= s,_,-,
|
|
|
|
|
|
|
|
debug_info_plist.input = $$QMAKESPEC/Info.plist.dSYM.in
|
|
|
|
debug_info_plist.output = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist
|
|
|
|
QMAKE_SUBSTITUTES += debug_info_plist
|
|
|
|
}
|
2016-06-11 03:27:53 +00:00
|
|
|
|
|
|
|
contains(INSTALLS, target):isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) {
|
|
|
|
!build_pass|release {
|
|
|
|
debug_info_plist_target.CONFIG += no_check_exist
|
|
|
|
debug_info_plist_target.files = $${debug_info_target}.$$debug_info_suffix/Contents/Info.plist
|
|
|
|
debug_info_plist_target.path += $${target.path}/$${debug_info_target_rel}.$$debug_info_suffix/Contents
|
|
|
|
INSTALLS += debug_info_plist_target
|
|
|
|
}
|
|
|
|
|
|
|
|
debug_info_target.CONFIG += no_check_exist
|
|
|
|
debug_info_target.files = $$QMAKE_TARGET_DEBUG_INFO
|
|
|
|
debug_info_target.path += $${target.path}/$${debug_info_target_dir_rel}
|
|
|
|
INSTALLS += debug_info_target
|
|
|
|
}
|
2016-04-07 03:37:44 +00:00
|
|
|
} else {
|
|
|
|
QMAKE_TARGET_DEBUG_INFO = $${QMAKE_RESOLVED_TARGET}.$$debug_info_suffix
|
2016-06-11 03:27:53 +00:00
|
|
|
target.targets += $$QMAKE_TARGET_DEBUG_INFO
|
2016-04-07 03:37:44 +00:00
|
|
|
}
|
2015-03-12 11:33:18 +00:00
|
|
|
|
|
|
|
shell_target = $$shell_quote($$relative_path($$QMAKE_RESOLVED_TARGET, $$OUT_PWD))
|
|
|
|
shell_target_debug_info = $$shell_quote($$relative_path($$QMAKE_TARGET_DEBUG_INFO, $$OUT_PWD))
|
2016-04-07 03:37:44 +00:00
|
|
|
copy_debug_info = $$debug_info_copy_bin $$debug_info_keep $$shell_target $$debug_info_out $$shell_target_debug_info
|
|
|
|
strip_debug_info = $$debug_info_strip_bin $$debug_info_strip $$shell_target
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
|
2016-04-07 03:37:44 +00:00
|
|
|
darwin {
|
|
|
|
mkdir_debug_info = $$QMAKE_MKDIR $$shell_quote($$debug_info_target_dir)
|
|
|
|
QMAKE_POST_LINK = $$mkdir_debug_info && $$copy_debug_info && $$strip_debug_info $$QMAKE_POST_LINK
|
|
|
|
} else {
|
|
|
|
link_debug_info = $$QMAKE_OBJCOPY --add-gnu-debuglink=$$shell_target_debug_info $$shell_target
|
2016-10-05 10:31:51 +00:00
|
|
|
!contains(QMAKE_HOST.os, Windows): \
|
|
|
|
QMAKE_POST_LINK = && chmod -x $$shell_target_debug_info $$QMAKE_POST_LINK
|
|
|
|
QMAKE_POST_LINK = $$copy_debug_info && $$strip_debug_info && $$link_debug_info $$QMAKE_POST_LINK
|
2016-04-07 03:37:44 +00:00
|
|
|
}
|
2012-09-25 13:30:44 +00:00
|
|
|
silent:QMAKE_POST_LINK = @echo creating $@.$$debug_info_suffix && $$QMAKE_POST_LINK
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-03-12 11:33:18 +00:00
|
|
|
QMAKE_DISTCLEAN += $$QMAKE_TARGET_DEBUG_INFO
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|