From 731f6c971c5e01c89900d9b8d5efd94c7a6b4b6d Mon Sep 17 00:00:00 2001 From: Cynthia Jiang Date: Sun, 24 Apr 2022 11:06:34 -0700 Subject: [PATCH] reduce android sdk size by stripping the debug symbol --- cmake/build_shared.cmake | 4 ++++ cmake/build_universal.cmake | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cmake/build_shared.cmake b/cmake/build_shared.cmake index d2bf8799f..e8502f17b 100644 --- a/cmake/build_shared.cmake +++ b/cmake/build_shared.cmake @@ -88,6 +88,10 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME) # Link against the static libc++, which is the default done by Gradle. "-static-libstdc++" ) + add_custom_command(TARGET ${shared_target} POST_BUILD + COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -g -S -d --strip-debug --verbose + "lib${OUTPUT_NAME}.so" + COMMENT "Strip debug symbols done on final binary. lib${OUTPUT_NAME}.so") endif() unity_pack_native(${shared_target}) diff --git a/cmake/build_universal.cmake b/cmake/build_universal.cmake index 1ce66d01c..e14a086e8 100644 --- a/cmake/build_universal.cmake +++ b/cmake/build_universal.cmake @@ -87,6 +87,10 @@ function(build_uni TARGET_LINK_LIB_NAMES PROJECT_LIST_HEADER_VARIABLE) # Link against the static libc++, which is the default done by Gradle. "-static-libstdc++" ) + add_custom_command(TARGET firebase_app_uni POST_BUILD + COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -g -S -d --strip-debug --verbose + "lib${FIREBASE_APP_UNI_VERSIONED}.so" + COMMENT "Strip debug symbols done on final binary. lib${FIREBASE_APP_UNI_VERSIONED}.so") endif() unity_pack_native(firebase_app_uni)