diff options
author | Martin Storsjö <martin@martin.st> | 2024-06-11 09:03:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 09:03:41 +0300 |
commit | 41c650e8208f7804eb5ecd8749d6b31b6e518bb7 (patch) | |
tree | 7915d336d3667d586b3ea6bee3eb373a917ec7c4 /clang/CMakeLists.txt | |
parent | 48f8130a49aad715ff6d5136dad2447d41e9537b (diff) | |
download | llvm-41c650e8208f7804eb5ecd8749d6b31b6e518bb7.zip llvm-41c650e8208f7804eb5ecd8749d6b31b6e518bb7.tar.gz llvm-41c650e8208f7804eb5ecd8749d6b31b6e518bb7.tar.bz2 |
[clang] Don't use -Wno-nested-anon-types on GCC (#95029)
GCC usually doesn't warn about unrecognized -Wno-<foo> options, if no
diagnostics are printed. However if some diagnostics are printed, it
also mentions that there were unrecognized -Wno-<foo> options.
Before 4feae05c6abda364a9295aecfa600d7d4e7dfeb6, we checked for whether
-Wnested-anon-types was supported, and added the -Wno-<foo> form if the
positive form of the option was supported.
As of GCC 14, -Wnested-anon-types isn't supported, thus limit the use of
the option to actual Clang (and still only while using the GCC
compatible driver).
This avoids unnecessary mentions about unrecognized -Wno-<foo> options
when building with GCC.
Diffstat (limited to 'clang/CMakeLists.txt')
-rw-r--r-- | clang/CMakeLists.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index f6d9625..c649616 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -350,7 +350,9 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long") endif () - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) + endif () endif () # Determine HOST_LINK_VERSION on Darwin. |