Avoid leaking freetype compiler flags to the rest of the project.

Add freetype_private_config so FreeType can suppress the unused
functions warning in its own build target, while not transitively
affecting all its dependencies. With this CL, Clang will emit warnings
when it detects unused functions in first party PDFium code, as
expected.

Change-Id: I7eec59f584dab4d634a1b0e17a0db46184fde995
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/101893
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 94dba84..29c2a0c 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -63,6 +63,9 @@
       "FT_CONFIG_MODULES_H=\"freetype-custom-config/ftmodule.h\"",
       "FT_CONFIG_OPTIONS_H=\"freetype-custom-config/ftoption.h\"",
     ]
+  }
+
+  config("freetype_private_config") {
     if (is_clang) {
       # Multiple functions in freetype/src/src/truetype/ttobjs.h are unused.
       cflags = [ "-Wno-unused-function" ]
@@ -75,6 +78,7 @@
     configs -= [ "//build/config/compiler:chromium_code" ]
     configs += [
       "//build/config/compiler:no_chromium_code",
+      ":freetype_private_config",
       ":pdfium_third_party_config",
     ]