diff --git a/engine/src/flutter/shell/config.gni b/engine/src/flutter/shell/config.gni index b578951627a..ab82f26f24d 100644 --- a/engine/src/flutter/shell/config.gni +++ b/engine/src/flutter/shell/config.gni @@ -5,4 +5,5 @@ declare_args() { shell_enable_vulkan = false shell_enable_metal = false + stripped_symbols = true } diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index 3d07b6a2cf5..934120e0a56 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/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/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index 9099d346744..8d345d85271 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -264,6 +264,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): @@ -335,6 +337,10 @@ def parse_args(args): parser.add_argument('--bitcode', default=False, action='store_true', help='Enable bitcode for iOS targets. On debug runtime modes, this will be a marker only.') + 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):