Skip to content

Commit 0cfb628

Browse files
authored
Set NOMINMAX for Firestore Windows builds (#1185)
1 parent 5501543 commit 0cfb628

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

firestore/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ set(firebase_firestore_src
9595
src/ValueSerializer.cs
9696
)
9797

98+
# Ensure min/max macros don't get declared on Windows
99+
# (so we can use std::min/max).
100+
if(MSVC)
101+
add_definitions(-DNOMINMAX)
102+
endif()
103+
98104
add_subdirectory(src/swig)
99105

100106
firebase_swig_add_library(firebase_firestore_swig

firestore/src/swig/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ add_library(firebase_firestore_swig_cpp STATIC
3030

3131
set_property(TARGET firebase_firestore_swig_cpp PROPERTY FOLDER "Firebase Cpp")
3232

33+
# Ensure min/max macros don't get declared on Windows
34+
# (so we can use std::min/max).
35+
if(MSVC)
36+
add_definitions(-DNOMINMAX)
37+
endif()
38+
3339
target_link_libraries(firebase_firestore_swig_cpp
3440
PUBLIC
3541
firebase_app

0 commit comments

Comments
 (0)