File tree Expand file tree Collapse file tree 5 files changed +50
-15
lines changed Expand file tree Collapse file tree 5 files changed +50
-15
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ option(FIREBASE_INCLUDE_INSTALLATIONS
52
52
${FIREBASE_INCLUDE_LIBRARY_DEFAULT} )
53
53
option (FIREBASE_INCLUDE_FIRESTORE
54
54
"Include the Firebase Firestore library."
55
- ${FIREBASE_INCLUDE_LIBRARY_DEFAULT} )
55
+ OFF )
56
56
option (FIREBASE_INCLUDE_FUNCTIONS
57
57
"Include the Cloud Functions for Firebase library."
58
58
${FIREBASE_INCLUDE_LIBRARY_DEFAULT} )
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ include(build_shared)
19
19
# Firebase Auth Swig input files
20
20
set (firebase_auth_swig
21
21
src/swig/auth.i
22
- ${FIREBASE_SOURCE_DIR} /empty.cc
23
22
)
24
23
25
24
# Firebase Auth CSharp files
Original file line number Diff line number Diff line change @@ -25,15 +25,19 @@ include(build_firebase_aar)
25
25
# OUTPUT_NAME: The output name to use for the shared library
26
26
function (build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME )
27
27
28
- set (shared_target "firebase_${LIBRARY_NAME} _swig " )
28
+ set (shared_target "firebase_${LIBRARY_NAME} _shared " )
29
29
30
- # add_library(${shared_target} SHARED
31
- # ${FIREBASE_SOURCE_DIR}/empty.cc
32
- # )
30
+ add_library (${shared_target} SHARED
31
+ ${FIREBASE_SOURCE_DIR} /empty.cc
32
+ )
33
33
34
34
set (SHARED_TARGET_LINK_LIB_NAMES "firebase_${LIBRARY_NAME} " "firebase_${LIBRARY_NAME} _swig" )
35
35
message ("SHARED_TARGET_LINK_LIB_NAMES is ${SHARED_TARGET_LINK_LIB_NAMES} " )
36
36
37
+ target_link_libraries (${shared_target}
38
+ ${SHARED_TARGET_LINK_LIB_NAMES}
39
+ )
40
+
37
41
# Update output name
38
42
set_target_properties (${shared_target}
39
43
PROPERTIES
@@ -66,16 +70,32 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
66
70
)
67
71
endif ()
68
72
69
- if (ANDROID )
73
+ if (MSVC )
74
+ target_link_options (${shared_target}
75
+ PRIVATE
76
+ "/WHOLEARCHIVE"
77
+ )
78
+ elseif (APPLE )
79
+ target_link_options (${shared_target}
80
+ PRIVATE
81
+ "-Wl,-all_load"
82
+ )
83
+ elseif (ANDROID )
70
84
target_link_options (${shared_target}
71
85
PRIVATE
72
86
"-llog"
73
87
"-Wl,-z,defs"
74
88
"-Wl,--no-undefined"
75
89
# Link against the static libc++, which is the default done by Gradle.
76
90
"-static-libstdc++"
91
+ "-Wl,--whole-archive"
77
92
)
78
- endif ()
93
+ else ()
94
+ target_link_options (${shared_target}
95
+ PRIVATE
96
+ "-Wl,--whole-archive"
97
+ )
98
+ endif ()
79
99
80
100
unity_pack_native (${shared_target} )
81
101
Original file line number Diff line number Diff line change @@ -78,16 +78,32 @@ function(build_uni TARGET_LINK_LIB_NAMES PROJECT_LIST_HEADER_VARIABLE)
78
78
${FIREBASE_SYSTEM_DEPS}
79
79
)
80
80
81
- if (ANDROID )
81
+ if (MSVC )
82
+ target_link_options (firebase_app_uni
83
+ PRIVATE
84
+ "/WHOLEARCHIVE"
85
+ )
86
+ elseif (APPLE )
87
+ target_link_options (firebase_app_uni
88
+ PRIVATE
89
+ "-Wl,-all_load"
90
+ )
91
+ elseif (ANDROID )
82
92
target_link_options (firebase_app_uni
83
93
PRIVATE
84
94
"-llog"
85
95
"-Wl,-z,defs"
86
96
"-Wl,--no-undefined"
87
97
# Link against the static libc++, which is the default done by Gradle.
88
98
"-static-libstdc++"
99
+ "-Wl,--whole-archive"
89
100
)
90
- endif ()
101
+ else ()
102
+ target_link_options (firebase_app_uni
103
+ PRIVATE
104
+ "-Wl,--whole-archive"
105
+ )
106
+ endif ()
91
107
92
108
unity_pack_native (firebase_app_uni )
93
109
Original file line number Diff line number Diff line change @@ -232,10 +232,10 @@ function(unity_pack_native name)
232
232
233
233
get_target_property (target_type ${name} TYPE )
234
234
235
- # if(NOT "${target_type}" STREQUAL "SHARED_LIBRARY")
236
- # message("unity_pack_native ${target_type} not equal SHARED_LIBRARY, returned")
237
- # return()
238
- # 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 ()
239
239
240
240
set (dll_dest "${UNITY_PACK_NATIVE_DIR} /" )
241
241
@@ -258,7 +258,7 @@ function(unity_pack_native name)
258
258
DESTINATION "${dll_dest} "
259
259
COMPONENT "runtime"
260
260
ARCHIVE
261
- DESTINATION "${dll_dest } "
261
+ DESTINATION "${lib_dest } "
262
262
COMPONENT "runtime"
263
263
)
264
264
You can’t perform that action at this time.
0 commit comments