Skip to content

Commit 97a784e

Browse files
authored
[llvm][cmake][Trivial] use /Zc:preprocessor with MSVC only explicitly (llvm#111520)
Only MSVC recognizes this flag, so be explicit. As an example the Intel C++ Compiler (IntelLLVM in CMake) also has an MSVC compatible CLI, but does not suppport this flag.
1 parent 88a239d commit 97a784e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ if( MSVC )
581581

582582
append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
583583

584-
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
584+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
585585
# Enable standards-conforming preprocessor.
586586
# https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor
587587
append("/Zc:preprocessor" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

0 commit comments

Comments
 (0)