Skip to content

Commit

Permalink
Defining NOMINMAX for windows to prevent std::{min,max} issues
Browse files Browse the repository at this point in the history
  • Loading branch information
COM8 committed Dec 28, 2023
1 parent 0e1b1d0 commit 544c9fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ else()
restore_variable(DESTINATION CMAKE_CXX_CLANG_TIDY BACKUP CMAKE_CXX_CLANG_TIDY_BKP)
endif()

# Add the NOMINMAX macro for windows to curl to prevent issues with std::min and std::max down the line.
# Ref: https://github.com/libcpr/cpr/issues/957
if(WIN32)
target_compile_definitions(CURL::libcurl PUBLIC NOMINMAX)
endif()

# GTest configuration
if(CPR_BUILD_TESTS)
if(CPR_USE_SYSTEM_GTEST)
Expand Down

0 comments on commit 544c9fc

Please sign in to comment.