diff --git a/shell/config.gni b/shell/config.gni index b578951627a95..ab82f26f24de2 100644 --- a/shell/config.gni +++ b/shell/config.gni @@ -5,4 +5,5 @@ declare_args() { shell_enable_vulkan = false shell_enable_metal = false + stripped_symbols = true } diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 3d07b6a2cf58d..934120e0a563a 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -306,9 +306,15 @@ action("icudtl_object") { action("android") { script = "//build/android/gyp/create_flutter_jar.py" + if (stripped_symbols) { + engine_library = "lib.stripped/libflutter.so" + } else { + engine_library = "libflutter.so" + } + inputs = [ "$root_build_dir/$embedding_jar_filename", - "$root_build_dir/lib.stripped/libflutter.so", + "$root_build_dir/$engine_library", ] engine_artifact_id = @@ -329,7 +335,7 @@ action("android") { "--dist_jar", rebase_path(embedding_jar_filename, root_build_dir, root_build_dir), "--native_lib", - rebase_path("lib.stripped/libflutter.so", root_build_dir, root_build_dir), + rebase_path("$engine_library", root_build_dir, root_build_dir), "--android_abi", "$android_app_abi", ] diff --git a/tools/gn b/tools/gn index 7c90cbb8eab92..4c4182f3581d0 100755 --- a/tools/gn +++ b/tools/gn @@ -262,6 +262,8 @@ def to_gn_args(args): if args.build_glfw_shell: gn_args['build_glfw_shell'] = True + gn_args['stripped_symbols'] = args.stripped + return gn_args def parse_args(args): @@ -333,6 +335,10 @@ def parse_args(args): parser.add_argument('--bitcode', default=False, action='store_true', help='Enable bitcode for iOS targets.') + parser.add_argument('--stripped', default=True, action='store_true', + help='Strip debug symbols from the output. This defaults to true and has no effect on iOS.') + parser.add_argument('--no-stripped', dest='stripped', action='store_false') + return parser.parse_args(args) def main(argv):