Skip to content

Commit 2041c0a

Browse files
committed
On Windows, absl's time_internal library does some stuff to achieve
having a weak symbol. This completely fails in our binary builds. Our binary builds don't care about zone_info_source_factory being a weak symbol. This change makes absl time_info no longer broken on Windows.
1 parent 406fc4b commit 2041c0a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

firestore/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ if (WIN32 AND NOT ANDROID AND NOT IOS)
325325
# On Windows, gRPC gives a compiler error in firebase_metadata_provider_desktop.cc
326326
# unless _WIN32_WINNT is defined to this value (0x0600, Windows Vista).
327327
set(FIREBASE_FIRESTORE_CPP_DEFINES ${FIREBASE_FIRESTORE_CPP_DEFINES} -D_WIN32_WINNT=0x0600 -DNOMINMAX)
328+
# Special handling for the absl time zone library, define _LIBCPP_VERSION on
329+
# Windows to avoid the shenanigans they do with Windows mangled symbols to
330+
# accomplish weak linking. See
331+
# https://github.com/google/cctz/blob/master/src/zone_info_source.cc for a
332+
# look at what we're up against.
333+
target_compile_definitions(absl_time_zone "-D_LIBCPP_VERSION=99")
328334
endif()
329335

330336
target_compile_definitions(firebase_firestore

0 commit comments

Comments
 (0)