Skip to content

Commit a538ea3

Browse files
author
Cynthia Jiang
committed
test
1 parent 36362e3 commit a538ea3

File tree

14 files changed

+33
-24
lines changed

14 files changed

+33
-24
lines changed

analytics/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ build_firebase_shared(
5656
FirebaseCppAnalytics
5757
)
5858

59-
unity_pack_native(firebase_analytics_swig)
6059
unity_pack_cs(firebase_analytics_cs)
6160

6261
if (FIREBASE_INCLUDE_UNITY)

app/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ mono_add_library(firebase_app_cs
9999
${firebase_native_library}
100100
)
101101

102-
unity_pack_native(firebase_app_swig)
103102
unity_pack_cs(firebase_app_cs)
104103

105104
if (FIREBASE_INCLUDE_UNITY)

auth/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ include(build_shared)
1919
# Firebase Auth Swig input files
2020
set(firebase_auth_swig
2121
src/swig/auth.i
22+
${FIREBASE_SOURCE_DIR}/empty.cc
2223
)
2324

2425
# Firebase Auth CSharp files
@@ -70,7 +71,6 @@ build_firebase_shared(
7071
FirebaseCppAuth
7172
)
7273

73-
unity_pack_native(firebase_auth_swig)
7474
unity_pack_cs(firebase_auth_cs)
7575

7676
if (FIREBASE_INCLUDE_UNITY)

cmake/build_shared.cmake

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ include(build_firebase_aar)
2525
# OUTPUT_NAME: The output name to use for the shared library
2626
function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
2727

28-
set(shared_target "firebase_${LIBRARY_NAME}_shared")
29-
add_library(${shared_target} SHARED
30-
${FIREBASE_SOURCE_DIR}/empty.cc
31-
)
32-
target_link_libraries(${shared_target}
33-
"firebase_${LIBRARY_NAME}_swig"
34-
)
28+
set(shared_target "firebase_${LIBRARY_NAME}_swig")
29+
30+
# add_library(${shared_target} SHARED
31+
# ${FIREBASE_SOURCE_DIR}/empty.cc
32+
# )
33+
34+
set(SHARED_TARGET_LINK_LIB_NAMES "firebase_${LIBRARY_NAME}" "firebase_${LIBRARY_NAME}_swig")
35+
message("SHARED_TARGET_LINK_LIB_NAMES is ${SHARED_TARGET_LINK_LIB_NAMES}")
3536

37+
# Update output name
3638
set_target_properties(${shared_target}
3739
PROPERTIES
3840
OUTPUT_NAME "${OUTPUT_NAME}"
@@ -52,12 +54,28 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
5254
PREFIX "lib"
5355
SUFFIX ".a"
5456
)
57+
elseif(ANDROID)
58+
set_target_properties(${shared_target}
59+
PROPERTIES
60+
PREFIX "lib"
61+
)
5562
else()
5663
set_target_properties(${shared_target}
5764
PROPERTIES
5865
PREFIX ""
5966
)
6067
endif()
68+
69+
if(ANDROID)
70+
target_link_options(${shared_target}
71+
PRIVATE
72+
"-llog"
73+
"-Wl,-z,defs"
74+
"-Wl,--no-undefined"
75+
# Link against the static libc++, which is the default done by Gradle.
76+
"-static-libstdc++"
77+
)
78+
endif()
6179

6280
unity_pack_native(${shared_target})
6381

cmake/unity_pack.cmake

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,18 @@ endfunction()
224224
# * Libraries are put into build arch folder
225225
#
226226
function(unity_pack_native name)
227-
228227
if(NOT FIREBASE_PACK_NATIVE)
229228
return()
230229
endif()
231230

231+
message("unity_pack_native pack ${name}")
232+
232233
get_target_property(target_type ${name} TYPE)
233234

234-
if(NOT "${target_type}" STREQUAL "SHARED_LIBRARY")
235-
return()
236-
endif()
235+
# if(NOT "${target_type}" STREQUAL "SHARED_LIBRARY")
236+
# message("unity_pack_native ${target_type} not equal SHARED_LIBRARY, returned")
237+
# return()
238+
# endif()
237239

238240
set(dll_dest "${UNITY_PACK_NATIVE_DIR}/")
239241

@@ -256,7 +258,7 @@ function(unity_pack_native name)
256258
DESTINATION "${dll_dest}"
257259
COMPONENT "runtime"
258260
ARCHIVE
259-
DESTINATION "${lib_dest}"
261+
DESTINATION "${dll_dest}"
260262
COMPONENT "runtime"
261263
)
262264

crashlytics/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ mono_add_library(firebase_crashlytics_cs
8989
FIREBASE_OPENSOURCE
9090
)
9191

92-
unity_pack_native(firebase_crashlytics_swig)
9392
unity_pack_cs(firebase_crashlytics_cs)
9493

9594
if (FIREBASE_INCLUDE_UNITY)

database/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ build_firebase_shared(
7474
FirebaseCppDatabase
7575
)
7676

77-
unity_pack_native(firebase_database_swig)
7877
unity_pack_cs(firebase_database_cs)
7978

8079
if (FIREBASE_INCLUDE_UNITY)

dynamic_links/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ build_firebase_shared(
6868
FirebaseCppDynamicLinks
6969
)
7070

71-
unity_pack_native(firebase_dynamic_links_swig)
7271
unity_pack_cs(firebase_dynamic_links_cs)
7372

7473
if (FIREBASE_INCLUDE_UNITY)

firestore/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ build_firebase_shared(
148148
FirebaseCppFirestore
149149
)
150150

151-
unity_pack_native(firebase_firestore_swig)
152151
unity_pack_cs(firebase_firestore_cs)
153152

154153
if (FIREBASE_INCLUDE_UNITY)

functions/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ build_firebase_shared(
6060
FirebaseCppFunctions
6161
)
6262

63-
unity_pack_native(firebase_functions_swig)
6463
unity_pack_cs(firebase_functions_cs)
6564

6665
if (FIREBASE_INCLUDE_UNITY)

0 commit comments

Comments
 (0)