diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -481,6 +481,10 @@ append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + # Enable standards-conforming preprocessor. + # https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor + append("/Zc:preprocessor" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + # Some projects use the __cplusplus preprocessor macro to check support for # a particular version of the C++ standard. When this option is not specified # explicitly, macro's value is "199711L" that implies C++98 Standard.