[llvm] 401dee4 - Reapply "[cmake][msvc] Enable standards-conforming preprocessor"
Jan Svoboda via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 8 13:48:25 PST 2023
Author: Jan Svoboda
Date: 2023-02-08T13:47:58-08:00
New Revision: 401dee445196a4a97b2ad2ca7cfc125b776be7f3
URL: https://github.com/llvm/llvm-project/commit/401dee445196a4a97b2ad2ca7cfc125b776be7f3
DIFF: https://github.com/llvm/llvm-project/commit/401dee445196a4a97b2ad2ca7cfc125b776be7f3.diff
LOG: 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
Added:
Modified:
llvm/cmake/modules/HandleLLVMOptions.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 7173e2724097a..7d65304b2ac77 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.
More information about the llvm-commits
mailing list