[bloaty] Temporarily disable -Wdeprecated-copy-with-user-provided-copy"

An upstream clang commit made -Wdeprecated-copy more aggressive which
led to new warning instances after the last clang roll. It seems many of
these instances occur in gmock which have yet to be fixed in upstream
googletest. We can suppress these new instances without disabling
-Wdeprecated-copy alltogether by just disabling
-Wdeprecated-copy-with-user-provided-copy.

Note that we can't necessarily disable it in googletest for now because
googletest is integrated as a submodule and not yet fixed at head.

Bug: 77652
Change-Id: I0f17413416680df62139bc01799200d28b8bb4e3
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/bloaty/+/537261
Reviewed-by: Oliver Newman <olivernewman@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8309cff..9db1187 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,10 +250,19 @@
 
     if(BUILD_TESTING)
       option(INSTALL_GTEST "" OFF)
+
       add_subdirectory(third_party/googletest)
       include_directories(third_party/googletest/googletest/include)
       include_directories(third_party/googletest/googlemock/include)
 
+      # FIXME(fxbug.dev/77652): Remove this once
+      # https://github.com/google/googletest/issues/3427 is addressed in googletest.
+      if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+        set_target_properties(gmock
+          PROPERTIES
+          COMPILE_FLAGS "-Wno-deprecated-copy-with-user-provided-copy")
+      endif()
+
       set(TEST_TARGETS
           bloaty_test
           bloaty_misc_test