Build: Work around VS2019 compiler error when compiling DPC++

Pull Request: https://projects.blender.org/blender/blender/pulls/132763
This commit is contained in:
Xavier Hallade
2025-01-22 15:37:29 +01:00
committed by Gitea
parent bdb093f58d
commit 886cd0244f

View File

@@ -265,3 +265,17 @@ index ec740f913ed4..c0e04bfaf119 100644
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 63a5bfe09a03..0eb3fd2adf20 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -575,6 +575,9 @@ if( MSVC )
append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+ # Zc:lambda works around VS19 internal compiler errors.
+ append("/Zc:lambda" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Enable standards-conforming preprocessor.
# https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor