Skip to content

Commit 0beb518

Browse files
committed
Defining NOMINMAX for windows to prevent std::{min,max} issues
1 parent 5191512 commit 0beb518

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ else()
280280
restore_variable(DESTINATION CMAKE_CXX_CLANG_TIDY BACKUP CMAKE_CXX_CLANG_TIDY_BKP)
281281
endif()
282282

283+
# Add the NOMINMAX macro for windows to curl to prevent issues with std::min and std::max down the line.
284+
# Ref: https://github.com/libcpr/cpr/issues/957
285+
if(WIN32)
286+
target_compile_definitions(CURL::libcurl PUBLIC NOMINMAX)
287+
endif()
288+
283289
# GTest configuration
284290
if(CPR_BUILD_TESTS)
285291
if(CPR_USE_SYSTEM_GTEST)

0 commit comments

Comments
 (0)