[llvm] ed803c8 - Properly initialize `CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG` CMake variable
Vlad Serebrennikov via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 07:16:38 PDT 2024
Author: Vlad Serebrennikov
Date: 2024-05-23T17:16:32+03:00
New Revision: ed803c879a8c100c59b5476a2ef6de64b2bf625f
URL: https://github.com/llvm/llvm-project/commit/ed803c879a8c100c59b5476a2ef6de64b2bf625f
DIFF: https://github.com/llvm/llvm-project/commit/ed803c879a8c100c59b5476a2ef6de64b2bf625f.diff
LOG: Properly initialize `CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG` CMake variable
A follow-up for #92953. Addresses the following buildbot failures:
https://lab.llvm.org/buildbot/#/builders/36/builds/45836
https://lab.llvm.org/buildbot/#/builders/57/builds/35200
Added:
Modified:
llvm/cmake/modules/HandleLLVMOptions.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 46b17711b9df2..fa672b755dd69 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -817,7 +817,10 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
endif()
append("-Wimplicit-fallthrough" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
+ set(CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG 0)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG 1)
append("-Wcovered-switch-default" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
More information about the llvm-commits
mailing list