From 401dee445196a4a97b2ad2ca7cfc125b776be7f3 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 8 Feb 2023 13:46:37 -0800 Subject: [PATCH] Reapply "[cmake][msvc] Enable standards-conforming preprocessor" This reverts commit 16e1a49441c51817697138437d8db2c15bc19cb4, essentially reapplying 12d8e7c6ade55bba241259312e3e4bdcf6aeab81. The build bot where this caused issues is supposed to be updated now: https://reviews.llvm.org/D135128#4108588 --- llvm/cmake/modules/HandleLLVMOptions.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 7173e2724097..7d65304b2ac7 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -494,6 +494,10 @@ if( MSVC ) 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. -- 2.34.1