Skip to content

Commit 2b6d585

Browse files
author
Cynthia Jiang
committed
test
1 parent caba09f commit 2b6d585

File tree

3 files changed

+19
-37
lines changed

3 files changed

+19
-37
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ option(FIREBASE_INCLUDE_INSTALLATIONS
5252
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5353
option(FIREBASE_INCLUDE_FIRESTORE
5454
"Include the Firebase Firestore library."
55-
OFF)
55+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5656
option(FIREBASE_INCLUDE_FUNCTIONS
5757
"Include the Cloud Functions for Firebase library."
5858
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})

cmake/build_shared.cmake

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
2929

3030
add_library(${shared_target} SHARED
3131
${FIREBASE_SOURCE_DIR}/empty.cc
32+
$<TARGET_OBJECTS:firebase_${LIBRARY_NAME}_swig>
3233
)
34+
35+
# add_dependencies(${shared_target}
36+
# firebase_${LIBRARY_NAME}
37+
# firebase_app
38+
# )
3339

3440
set(SHARED_TARGET_LINK_LIB_NAMES "firebase_${LIBRARY_NAME}" "firebase_${LIBRARY_NAME}_swig")
3541
message("SHARED_TARGET_LINK_LIB_NAMES is ${SHARED_TARGET_LINK_LIB_NAMES}")
@@ -38,6 +44,14 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
3844
${SHARED_TARGET_LINK_LIB_NAMES}
3945
)
4046

47+
# target_include_directories(${shared_target}
48+
# PUBLIC
49+
# ${CMAKE_CURRENT_LIST_DIR}
50+
# PRIVATE
51+
# ${FIREBASE_CPP_SDK_DIR}
52+
# ${FIREBASE_UNITY_DIR}
53+
# )
54+
4155
# Update output name
4256
set_target_properties(${shared_target}
4357
PROPERTIES
@@ -70,32 +84,16 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
7084
)
7185
endif()
7286

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)
87+
if(ANDROID)
8488
target_link_options(${shared_target}
8589
PRIVATE
8690
"-llog"
8791
"-Wl,-z,defs"
8892
"-Wl,--no-undefined"
8993
# Link against the static libc++, which is the default done by Gradle.
9094
"-static-libstdc++"
91-
"-Wl,--whole-archive"
92-
)
93-
else ()
94-
target_link_options(${shared_target}
95-
PRIVATE
96-
"-Wl,--whole-archive"
9795
)
98-
endif ()
96+
endif()
9997

10098
unity_pack_native(${shared_target})
10199

cmake/build_universal.cmake

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,32 +78,16 @@ function(build_uni TARGET_LINK_LIB_NAMES PROJECT_LIST_HEADER_VARIABLE)
7878
${FIREBASE_SYSTEM_DEPS}
7979
)
8080

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)
81+
if(ANDROID)
9282
target_link_options(firebase_app_uni
9383
PRIVATE
9484
"-llog"
9585
"-Wl,-z,defs"
9686
"-Wl,--no-undefined"
9787
# Link against the static libc++, which is the default done by Gradle.
9888
"-static-libstdc++"
99-
"-Wl,--whole-archive"
10089
)
101-
else ()
102-
target_link_options(firebase_app_uni
103-
PRIVATE
104-
"-Wl,--whole-archive"
105-
)
106-
endif ()
90+
endif()
10791

10892
unity_pack_native(firebase_app_uni)
10993

0 commit comments

Comments
 (0)