diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -789,7 +789,11 @@ add_flag_if_supported("-Wstring-conversion" STRING_CONVERSION_FLAG) # Prevent bugs that can happen with llvm's brace style. - add_flag_if_supported("-Wmisleading-indentation" MISLEADING_INDENTATION_FLAG) + if (CMAKE_COMPILER_IS_GNUCXX) + add_flag_if_supported("-Wno-misleading-indentation" MISLEADING_INDENTATION_FLAG) + else() + add_flag_if_supported("-Wmisleading-indentation" MISLEADING_INDENTATION_FLAG) + endif() endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL)) if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)