Skip to content

Commit 4405614

Browse files
cynthiajoanCynthia Jiang
and
Cynthia Jiang
authored
reduce android sdk size by stripping the debug symbol (#254)
Co-authored-by: Cynthia Jiang <[email protected]>
1 parent f00f38f commit 4405614

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cmake/build_shared.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
8888
# Link against the static libc++, which is the default done by Gradle.
8989
"-static-libstdc++"
9090
)
91+
add_custom_command(TARGET ${shared_target} POST_BUILD
92+
COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -g -S -d --strip-debug --verbose
93+
"lib${OUTPUT_NAME}.so"
94+
COMMENT "Strip debug symbols done on final binary. lib${OUTPUT_NAME}.so")
9195
endif()
9296

9397
unity_pack_native(${shared_target})

cmake/build_universal.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ function(build_uni TARGET_LINK_LIB_NAMES PROJECT_LIST_HEADER_VARIABLE)
8787
# Link against the static libc++, which is the default done by Gradle.
8888
"-static-libstdc++"
8989
)
90+
add_custom_command(TARGET firebase_app_uni POST_BUILD
91+
COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -g -S -d --strip-debug --verbose
92+
"lib${FIREBASE_APP_UNI_VERSIONED}.so"
93+
COMMENT "Strip debug symbols done on final binary. lib${FIREBASE_APP_UNI_VERSIONED}.so")
9094
endif()
9195

9296
unity_pack_native(firebase_app_uni)

0 commit comments

Comments
 (0)