From 7fb4708c03a204cec977624828bc4b69356301a9 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Thu, 13 May 2021 19:46:38 +0200 Subject: BUILD(cmake, windows): Prevent definition min/max macros These macros are defined in Windows.h if the NOMINMAX macro is not set. This then causes all other uses of the terms "min" and "max" (as e.g. in std::min, std::numeric_limits<>::min, etc.) to fail, which is unacceptable. Therefore NOMINMAX is now defined globally when compiling on Windows. --- cmake/os.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmake') diff --git a/cmake/os.cmake b/cmake/os.cmake index 46b46abe0..78ccfb8bf 100644 --- a/cmake/os.cmake +++ b/cmake/os.cmake @@ -32,6 +32,8 @@ if(WIN32) add_definitions( "-DUNICODE" "-DWIN32_LEAN_AND_MEAN" + # Prevent Windows headers from defining the macros "min" and "max" that mess up e.g. std::min usage + "-DNOMINMAX" ) else() if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") -- cgit v1.2.3