Skip to content

Commit 0a738ef

Browse files
authored
Add a define to Firestore C++ to work around a grpc Windows compile error. (#238)
* Add -D_WIN32_WINNT=0x0600 to Firestore compiler options, required on Windows.
1 parent 01d74f1 commit 0a738ef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

firestore/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,17 @@ else()
279279
)
280280
endif()
281281

282+
set(FIREBASE_FIRESTORE_CPP_DEFINES -DINTERNAL_EXPERIMENTAL=1)
283+
284+
if (WIN32 AND NOT ANDROID AND NOT IOS)
285+
# On Windows, gRPC gives a compiler error in firebase_metadata_provider_desktop.cc
286+
# unless _WIN32_WINNT is defined to this value (0x0600, Windows Vista).
287+
set(FIREBASE_FIRESTORE_CPP_DEFINES ${FIREBASE_FIRESTORE_CPP_DEFINES} -D_WIN32_WINNT=0x0600)
288+
endif()
282289

283290
target_compile_definitions(firebase_firestore
284291
PRIVATE
285-
-DINTERNAL_EXPERIMENTAL=1
292+
${FIREBASE_FIRESTORE_CPP_DEFINES}
286293
)
287294

288295
if(ANDROID)

0 commit comments

Comments
 (0)