Skip to content

Commit fd25f80

Browse files
authored
make it possible to disable debug symbols stripping (#11265)
1 parent 59e14bc commit fd25f80

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

shell/config.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
declare_args() {
66
shell_enable_vulkan = false
77
shell_enable_metal = false
8+
stripped_symbols = true
89
}

shell/platform/android/BUILD.gn

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,15 @@ action("icudtl_object") {
306306
action("android") {
307307
script = "//build/android/gyp/create_flutter_jar.py"
308308

309+
if (stripped_symbols) {
310+
engine_library = "lib.stripped/libflutter.so"
311+
} else {
312+
engine_library = "libflutter.so"
313+
}
314+
309315
inputs = [
310316
"$root_build_dir/$embedding_jar_filename",
311-
"$root_build_dir/lib.stripped/libflutter.so",
317+
"$root_build_dir/$engine_library",
312318
]
313319

314320
engine_artifact_id =
@@ -329,7 +335,7 @@ action("android") {
329335
"--dist_jar",
330336
rebase_path(embedding_jar_filename, root_build_dir, root_build_dir),
331337
"--native_lib",
332-
rebase_path("lib.stripped/libflutter.so", root_build_dir, root_build_dir),
338+
rebase_path("$engine_library", root_build_dir, root_build_dir),
333339
"--android_abi",
334340
"$android_app_abi",
335341
]

tools/gn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ def to_gn_args(args):
264264
if args.build_glfw_shell:
265265
gn_args['build_glfw_shell'] = True
266266

267+
gn_args['stripped_symbols'] = args.stripped
268+
267269
return gn_args
268270

269271
def parse_args(args):
@@ -335,6 +337,10 @@ def parse_args(args):
335337
parser.add_argument('--bitcode', default=False, action='store_true',
336338
help='Enable bitcode for iOS targets. On debug runtime modes, this will be a marker only.')
337339

340+
parser.add_argument('--stripped', default=True, action='store_true',
341+
help='Strip debug symbols from the output. This defaults to true and has no effect on iOS.')
342+
parser.add_argument('--no-stripped', dest='stripped', action='store_false')
343+
338344
return parser.parse_args(args)
339345

340346
def main(argv):

0 commit comments

Comments
 (0)