Ryan Harrison | 548ee54 | 2024-05-29 03:21:13 +0000 | [diff] [blame] | 1 | # Clean copy of third_party/libprotobuf-mutator/BUILD.gn from |
| 2 | # Chromium, with non-relavent portions removed |
| 3 | |
| 4 | # Copyright 2017 The Chromium Authors |
| 5 | # Use of this source code is governed by a BSD-style license that can be |
| 6 | # found in the LICENSE file. |
| 7 | |
| 8 | import("//build/config/sanitizers/sanitizers.gni") |
| 9 | import("//testing/libfuzzer/fuzzer_test.gni") |
| 10 | |
| 11 | config("public_config") { |
| 12 | include_dirs = [ "src/" ] |
| 13 | } |
| 14 | |
| 15 | config("private_config") { |
| 16 | cflags = [ "-Wno-shadow" ] |
| 17 | } |
| 18 | |
| 19 | source_set("libprotobuf-mutator") { |
| 20 | testonly = true |
| 21 | |
| 22 | # Remove *San and coverage for a performance boost. |
| 23 | configs -= not_fuzzed_remove_configs |
| 24 | configs += [ |
| 25 | "//build/config/sanitizers:not_fuzzed", |
| 26 | ":private_config", |
| 27 | ] |
| 28 | |
| 29 | public_configs = [ ":public_config" ] |
| 30 | |
| 31 | sources = [ |
| 32 | "src/src/binary_format.cc", |
| 33 | "src/src/libfuzzer/libfuzzer_macro.cc", |
| 34 | "src/src/libfuzzer/libfuzzer_mutator.cc", |
| 35 | "src/src/mutator.cc", |
| 36 | "src/src/text_format.cc", |
| 37 | "src/src/utf8_fix.cc", |
| 38 | ] |
| 39 | |
| 40 | # Allow users of LPM to use protobuf reflection and other features from |
| 41 | # protobuf_full. |
| 42 | public_deps = [ "//third_party/protobuf:protobuf_full" ] |
| 43 | |
| 44 | # Let ClusterFuzz builders know to not build targets that depend on |
| 45 | # libprotobuf-mutator for AFL or Chrome OS. |
| 46 | if (use_afl || current_toolchain == "//build/toolchain/cros:target") { |
| 47 | all_dependent_configs = [ "//testing/libfuzzer:no_clusterfuzz" ] |
| 48 | } |
| 49 | } |