From 07d0ecb9d6e2c0ad824f4ffdfe92358d89103123 Mon Sep 17 00:00:00 2001 From: Anthony Roberts Date: Mon, 12 Aug 2024 16:08:00 +0100 Subject: [PATCH] Windows: Fix OpenVDB errors when compiling with clang-cl Pull Request: https://projects.blender.org/blender/blender/pulls/126236 --- extern/mantaflow/CMakeLists.txt | 5 +++++ intern/cycles/scene/CMakeLists.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/extern/mantaflow/CMakeLists.txt b/extern/mantaflow/CMakeLists.txt index 311d8b8ab60..92de6116f68 100644 --- a/extern/mantaflow/CMakeLists.txt +++ b/extern/mantaflow/CMakeLists.txt @@ -101,6 +101,11 @@ if(WITH_OPENVDB) # for details. string(APPEND CMAKE_CXX_FLAGS " /wd4251") endif() + + # This works around the issue described in #120317 and https://github.com/AcademySoftwareFoundation/openvdb/pull/1786 + if(MSVC_CLANG) + set_source_files_properties(${MANTA_PP}/fileio/iovdb.cpp PROPERTIES COMPILE_FLAGS -fno-delayed-template-parsing) + endif() endif() set(SRC diff --git a/intern/cycles/scene/CMakeLists.txt b/intern/cycles/scene/CMakeLists.txt index 874b38525ed..90dad2415d3 100644 --- a/intern/cycles/scene/CMakeLists.txt +++ b/intern/cycles/scene/CMakeLists.txt @@ -132,6 +132,11 @@ if(WITH_OPENVDB) list(APPEND LIB ${OPENVDB_LIBRARIES} ) + + # This works around the issue described in #120317 and https://github.com/AcademySoftwareFoundation/openvdb/pull/1786 + if(MSVC_CLANG) + set_source_files_properties(image_vdb.cpp PROPERTIES COMPILE_FLAGS -fno-delayed-template-parsing) + endif() endif() if(WITH_ALEMBIC)