[Bf-blender-cvs] [418888f1c9a] master: MSVC: Fix build error with 16.10/11

Ray Molenkamp noreply at git.blender.org
Fri May 28 15:57:26 CEST 2021


Commit: 418888f1c9a3c3ca8facc04d271d48ad37e5f5b2
Author: Ray Molenkamp
Date:   Fri May 28 07:57:21 2021 -0600
Branches: master
https://developer.blender.org/rB418888f1c9a3c3ca8facc04d271d48ad37e5f5b2

MSVC: Fix build error with 16.10/11

Not entirely sure why this was not an issue for 16.9
but TBB includes the Windows.h header which by default
will define min and max macro's

These collide with the stl versions in <algorithm>

This patch requests Windows.h not to define the
problematic macro's, resolving the conflict.

===================================================================

M	source/blender/modifiers/CMakeLists.txt

===================================================================

diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 91327b97fe4..0138dd0c3ad 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -195,7 +195,11 @@ endif()
 
 if(WITH_TBB)
   add_definitions(-DWITH_TBB)
-
+  if(WIN32)
+    # TBB includes Windows.h which will define min/max macros
+    # that will collide with the stl versions.
+    add_definitions(-DNOMINMAX)
+  endif()
   list(APPEND INC_SYS
     ${TBB_INCLUDE_DIRS}
   )



More information about the Bf-blender-cvs mailing list