Skip to content

Commit 65384c0

Browse files
authored
Merge pull request #374 from firebase/fix/absl-symbol
Prevent absl_time_zone from using weak symbols on Windows.
2 parents 872b8ca + 9928d00 commit 65384c0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

firestore/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,14 @@ if (WIN32 AND NOT ANDROID AND NOT IOS)
326326
# unless _WIN32_WINNT is defined to this value (0x0600, Windows Vista).
327327
# Also set -DNOMINMAX for both Firestore and Firestore Core.
328328
set(FIREBASE_FIRESTORE_CPP_DEFINES ${FIREBASE_FIRESTORE_CPP_DEFINES} -D_WIN32_WINNT=0x0600 -DNOMINMAX)
329-
target_compile_definitions(firestore_core
329+
# Special handling for the absl time zone library, define _LIBCPP_VERSION on
330+
# Windows to avoid the shenanigans they do with Windows mangled symbols to
331+
# accomplish weak linking. See
332+
# https://github.com/google/cctz/blob/master/src/zone_info_source.cc for a
333+
# look at what we're up against.
334+
target_compile_definitions(absl_time_zone
330335
PRIVATE
331-
-DNOMINMAX
332-
)
336+
_LIBCPP_VERSION=99)
333337
endif()
334338

335339
target_compile_definitions(firebase_firestore

0 commit comments

Comments
 (0)