-
Notifications
You must be signed in to change notification settings - Fork 38
/
BreakpadSymbols
39 lines (31 loc) · 1.25 KB
/
BreakpadSymbols
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
import sys
builder.SetBuildFolder('symbols')
UPLOAD_SCRIPT = os.path.join(builder.sourcePath, 'tools', 'upload_symbols.py')
for cxx_task in Extension.extensions:
breakpad_dir = os.path.join(builder.sourcePath, 'tools', 'breakpad', cxx_task.target.platform)
if cxx_task.target.platform == 'windows':
debug_entry = cxx_task.debug
else:
debug_entry = cxx_task.binary
debug_file = os.path.join(builder.buildPath, debug_entry.path)
if cxx_task.target.platform == 'linux':
argv = [os.path.join(breakpad_dir, 'dump_syms'), debug_file, os.path.dirname(debug_file)]
elif cxx_task.target.platform == 'mac':
argv = [os.path.join(breakpad_dir, 'dump_syms'), '-g', debug_file + '.dSYM', debug_file]
elif cxx_task.target.platform == 'windows':
argv = [os.path.join(breakpad_dir, 'dump_syms.exe'), debug_file]
plat_dir = os.path.dirname(debug_file)
bin_dir = os.path.split(plat_dir)[0]
symbol_file = '{}-{}-{}.breakpad'.format(
os.path.split(bin_dir)[1],
cxx_task.target.platform,
cxx_task.target.arch
)
argv = [sys.executable, UPLOAD_SCRIPT, symbol_file] + argv
builder.AddCommand(
inputs = [UPLOAD_SCRIPT, debug_entry],
argv = argv,
outputs = [symbol_file]
)