Skip to content

Commit 9feede4

Browse files
author
Cynthia Jiang
committed
2 parents d902c18 + 476e4b8 commit 9feede4

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ option(FIREBASE_INCLUDE_AUTH
4141
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
4242
option(FIREBASE_INCLUDE_CRASHLYTICS
4343
"Include the Firebase Crashlytics library."
44-
OFF)
44+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
4545
option(FIREBASE_INCLUDE_DATABASE
4646
"Include the Firebase Realtime Database library."
4747
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})

build_android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ mkdir -p android_build
8080
pushd android_build
8181

8282
# Configure cmake with option value
83-
cmake .. ${CMAKE_OPTIONS}
83+
cmake .. ${CMAKE_OPTIONS} "$@"
8484
check_exit_code $?
8585

8686
# Build the SDK

crashlytics/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
# CMake file for the firebase crashlytics library
1616

17+
include(build_shared)
18+
1719
# Only for unity builds
1820
if(NOT FIREBASE_INCLUDE_UNITY)
1921
return()

crashlytics/src/cpp/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,28 @@ target_compile_definitions(firebase_crashlytics
6767
-DINTERNAL_EXPERIMENTAL=1
6868
)
6969

70+
# Generate the Proguard file
71+
if(ANDROID)
72+
set(FIREBASE_CPP_CRASHLYTICS_PROGUARD ${CMAKE_CURRENT_BINARY_DIR}/crashlytics.pro
73+
CACHE FILEPATH "Proguard file for Crashlytics" FORCE)
74+
75+
add_custom_command(
76+
OUTPUT ${FIREBASE_CPP_CRASHLYTICS_PROGUARD}
77+
COMMAND strings $<TARGET_FILE:firebase_crashlytics> |
78+
grep %PG% |
79+
sed -r 'sI/I.Ig' |
80+
sed -r 's/%PG%/-keep,includedescriptorclasses public class /g'
81+
> ${FIREBASE_CPP_CRASHLYTICS_PROGUARD}
82+
DEPENDS firebase_crashlytics
83+
COMMENT "Generating Crashlytics Proguard file."
84+
)
85+
86+
add_custom_target(
87+
FIREBASE_CPP_CRASHLYTICS_PROGUARD
88+
DEPENDS ${FIREBASE_CPP_CRASHLYTICS_PROGUARD}
89+
)
90+
endif()
91+
7092
if(IOS)
7193
# Enable Automatic Reference Counting (ARC).
7294
set_property(

0 commit comments

Comments
 (0)