From e5edfbadcf095c488b0ea60f0a7da9b3e0653be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Fri, 8 Nov 2024 14:42:12 +0100 Subject: [PATCH] Codefix: Silence clang-cl warnings (#13066) * Codefix ad5da0c: clang-cl doesn't need /Zc:preprocessor * Codefix: use -Wno-multichar with clang-cl --- cmake/CompileFlags.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index 073c01c2fdf9d..2f62a7b8b5b4d 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -8,11 +8,9 @@ macro(compile_flags) # C++11 standard". We need C++11 for the way we use threads. add_compile_options(/Zc:rvalueCast) - # Needed for __VA_OPT__() in macros. - add_compile_options(/Zc:preprocessor) - if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_compile_options( + /Zc:preprocessor # Needed for __VA_OPT__() in macros. /MP # Enable multi-threaded compilation. /FC # Display the full path of source code files passed to the compiler in diagnostics. ) @@ -58,6 +56,11 @@ macro(compile_flags) # This flag disables the broken optimisation to work around the bug add_compile_options(/d2ssa-rse-) endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_compile_options( + -Wno-multichar + ) + endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") add_compile_options( -W