[llvm] 0c098ae - [Support] [CMake] Only pass -Wno-c99-extensions to Clang, not GCC (#221822)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 23:42:39 PDT 2026
Author: Martin Storsjö
Date: 2026-09-08T09:42:34+03:00
New Revision: 0c098ae4518902f8f30abae5a620bf57fa84895a
URL: https://github.com/llvm/llvm-project/commit/0c098ae4518902f8f30abae5a620bf57fa84895a
DIFF: https://github.com/llvm/llvm-project/commit/0c098ae4518902f8f30abae5a620bf57fa84895a.diff
LOG: [Support] [CMake] Only pass -Wno-c99-extensions to Clang, not GCC (#221822)
GCC doesn't support this option, only Clang.
GCC doesn't warn if an unrecognized `-Wno-<foo>` option is passed, but
if GCC produces other warnings, it also adds a note about `-Wno-<foo>`
not being recognized, and that it may have been intended to silence the
warning that was produced.
Added:
Modified:
llvm/lib/Support/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 1a3fa39c81e29..c85c784993e20 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -407,7 +407,7 @@ target_include_directories(LLVMSupport
${LLVM_SOURCE_DIR}/../libc
)
-if(NOT MSVC)
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(LLVMSupport PRIVATE "-Wno-c99-extensions") # _Complex warnings.
endif()
More information about the llvm-commits
mailing list