Skip to content

Commit ad04089

Browse files
devajithvsvgvassilev
authored andcommitted
[cmake] Guard -Wno-macro-redefined behind NOT MSVC
When building clad as an external project, MSVC does not recognise -W flags and errors out with: ``` cl : command line error D8021: invalid numeric argument '/Wno-macro-redefined' ```
1 parent d6665f8 commit ad04089

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
192192
# LLVM 22 sets _GLIBCXX_USE_CXX11_ABI twice (HandleLLVMOptions +
193193
# LLVMConfig), which trips -Werror=macro-redefined. Suppress that
194194
# specific warning -- it's an upstream duplication, not a code bug.
195-
if (LLVM_VERSION_MAJOR GREATER_EQUAL 22)
195+
if (LLVM_VERSION_MAJOR GREATER_EQUAL 22 AND NOT MSVC)
196196
add_compile_options(-Wno-macro-redefined)
197197
endif()
198198

0 commit comments

Comments
 (0)