QUIC: Remove old Hello Extension (26)
[metze/wireshark/wip.git] / CMakeLists.txt
index 7c48c7563a3cf13f1d71877d1fcd8e53de5372cb..f58a1dbc9e37731c5c131f268ca31f3ab900ff65 100644 (file)
@@ -732,29 +732,22 @@ if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
        if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
                set(WERROR_COMMON_FLAGS "/WX")
        else()
-               check_c_compiler_flag(-Werror WERROR)
-               if (WERROR)
-                       set(WERROR_COMMON_FLAGS "-Werror")
-               endif()
-
                #
-               # Apple's llvm-gcc appears not to support suppressing
-               # warnings with pragmas, so, if we're building on a Mac
-               # (we check for APPLE), and we're not using Clang, we
-               # suppress errors for some warnings that we can only
-               # remove by suppressing them, as they're in generated
-               # code.
+               # If a warning has been enabled by -Wall or -W,
+               # and have specified -Werror, there appears to be
+               # no way, in Apple's llvm-gcc, to prevent that
+               # particular warning from giving an error - not
+               # with a pragma, not with -Wno-{warning}, and not
+               # with -Wno-error={warning}.
                #
-               # We have to do this *after* -Werror, otherwise the
-               # compiler decides -Werror means "never mind, make 'em
-               # all errors.
+               # Therefore, with that compiler, we just disable
+               # -Werror.
                #
-               if (APPLE AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
-                       list(APPEND WERROR_COMMON_FLAGS
-                               -Wno-error=comma
-                               -Wno-error=shorten-64-to-32
-                               -Wno-error=unused-function
-                       )
+               if ((NOT APPLE) OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+                       check_c_compiler_flag(-Werror WERROR)
+                       if (WERROR)
+                               set(WERROR_COMMON_FLAGS "-Werror")
+                       endif()
                endif()
        endif()
 endif()