diff options
| author | Eike Ziller <eike.ziller@qt.io> | 2020-11-12 11:27:34 +0100 |
|---|---|---|
| committer | Eike Ziller <eike.ziller@qt.io> | 2020-11-17 11:32:32 +0000 |
| commit | eb4d230e3818bef7290fb12911de1f0d3a98d565 (patch) | |
| tree | 49176d5fa71dac7b374178645c79b522ad67078c /scripts/build_plugin.py | |
| parent | 8f4532daaebf833c87e0258f86bf25457ff29fef (diff) | |
cmake build: Create DebugInfo component with separate debug info
When building with RelWithDebInfo. The CMake code is adapted from
corresponding (internal) functions from Qt 6.
Also let the scripts create an additional *-debug.7z with the debug
info.
Task-number: QTCREATORBUG-24916
Change-Id: Ibc3c8c0013718b9c5e868136e5ce01e1e99f84c4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'scripts/build_plugin.py')
| -rwxr-xr-x | scripts/build_plugin.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py index a8d40424a9f..c1b12a97f9e 100755 --- a/scripts/build_plugin.py +++ b/scripts/build_plugin.py @@ -59,7 +59,9 @@ def get_arguments(): action='store_true', default=False) parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)', default='RelWithDebInfo') - return parser.parse_args() + args = parser.parse_args() + args.with_debug_info = args.build_type == 'RelWithDebInfo' + return args def build(args, paths): if not os.path.exists(paths.build): @@ -117,6 +119,10 @@ def build(args, paths): common.check_print_call(['cmake', '--install', '.', '--prefix', paths.dev_install, '--component', 'Devel'], paths.build) + if args.with_debug_info: + common.check_print_call(['cmake', '--install', '.', '--prefix', paths.debug_install, + '--component', 'DebugInfo'], + paths.build) def package(args, paths): if not os.path.exists(paths.result): @@ -127,11 +133,15 @@ def package(args, paths): common.check_print_call(['7z', 'a', '-mmt2', os.path.join(paths.result, args.name + '_dev.7z'), '*'], paths.dev_install) + if args.with_debug_info: + common.check_print_call(['7z', 'a', '-mmt2', + os.path.join(paths.result, args.name + '-debug.7z'), '*'], + paths.debug_install) def get_paths(args): Paths = collections.namedtuple('Paths', ['qt', 'src', 'build', 'qt_creator', - 'install', 'dev_install', 'result']) + 'install', 'dev_install', 'debug_install', 'result']) build_path = os.path.abspath(args.build) install_path = os.path.join(build_path, 'install') result_path = os.path.abspath(args.output_path) if args.output_path else build_path @@ -141,6 +151,7 @@ def get_paths(args): qt_creator=os.path.abspath(args.qtc_path), install=os.path.join(install_path, args.name), dev_install=os.path.join(install_path, args.name + '-dev'), + debug_install=os.path.join(install_path, args.name + '-debug'), result=result_path) def main(): |
