[Bf-blender-cvs] [af824b09c7b] master: MSVC: Suppress C4251 in OpenVDB/Mantaflow

Ray Molenkamp noreply at git.blender.org
Wed Feb 17 20:23:06 CET 2021


Commit: af824b09c7b3eb4c70dccf116ee0e3790466a352
Author: Ray Molenkamp
Date:   Wed Feb 17 12:23:01 2021 -0700
Branches: master
https://developer.blender.org/rBaf824b09c7b3eb4c70dccf116ee0e3790466a352

MSVC: Suppress C4251 in OpenVDB/Mantaflow

All headers in the svn libraries should be
building with /W0 however MSVC 16.8/16.9
has broken this functionality making OpenVDB
emit lots of warnings.

The breakage was reported [1] in august to MS
but they still have not gotten around to
addressing the issue.

This change explicitly suppresses C4251 in the
module that emitted these warnings. As the warning
is useful in other parts of blender a localized
approach is taken rather than a global suppression.

[1] https://developercommunity.visualstudio.com/content/problem/1167590/bug.html

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

M	extern/mantaflow/CMakeLists.txt

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

diff --git a/extern/mantaflow/CMakeLists.txt b/extern/mantaflow/CMakeLists.txt
index c1fa13420b8..3220a45bef4 100644
--- a/extern/mantaflow/CMakeLists.txt
+++ b/extern/mantaflow/CMakeLists.txt
@@ -133,6 +133,14 @@ if(WITH_OPENVDB)
   list(APPEND LIB
     ${OPENVDB_LIBRARIES}
   )
+  if(WIN32)
+    # OpenVDB emits lots of these, they should be suppressed through other
+    # means but MSVC 16.8/16.9 has broken this functionality, so C4251 is
+    # suppressed here explicitly. See
+    # https://developercommunity.visualstudio.com/content/problem/1167590/bug.html
+    # for details.
+    string(APPEND CMAKE_CXX_FLAGS " /wd4251")
+  endif()
 endif()
 
 set(SRC



More information about the Bf-blender-cvs mailing list