Edit Brotli BUILD.gn to make fuzzers optional Embedders of Brotli from chromium's dependencies (ex: PDFium) do not need the fuzzers and usually do not include libfuzzer when standalone, hence this CL uses the build_with_chromium argument for these embedders so that the fuzzers do not need to be built and the additional dependency does not need to be pulled for the standalone repo. Bug: 475855993 Change-Id: Ia63de8690f5cc053305afb07701abdf52d2dd300 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7882000 Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1638220} NOKEYCHECK=True GitOrigin-RevId: 0f3cbd59af8502ab127acd8dd8fa950fed90d550
diff --git a/BUILD.gn b/BUILD.gn index bcc500d..0a9eb55 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -2,7 +2,11 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//testing/libfuzzer/fuzzer_test.gni") +import("//build/config/gclient_args.gni") + +if (build_with_chromium) { + import("//testing/libfuzzer/fuzzer_test.gni") +} if (is_win) { import("//build/config/win/visual_studio_version.gni") @@ -227,8 +231,10 @@ } } -fuzzer_test("brotli_fuzzer") { - sources = [ "fuzz/decode_fuzzer.c" ] - deps = [ ":dec" ] - libfuzzer_options = [ "max_len=1280" ] +if (build_with_chromium) { + fuzzer_test("brotli_fuzzer") { + sources = [ "fuzz/decode_fuzzer.c" ] + deps = [ ":dec" ] + libfuzzer_options = [ "max_len=1280" ] + } }