summaryrefslogtreecommitdiff
path: root/testing/fuzzers/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'testing/fuzzers/BUILD.gn')
-rw-r--r--testing/fuzzers/BUILD.gn55
1 files changed, 32 insertions, 23 deletions
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index 5a6af69f69..f528ad5c9d 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -65,11 +65,40 @@ group("fuzzers") {
}
}
+template("pdfium_public_fuzzer") {
+ source_set(target_name) {
+ sources = invoker.sources + [
+ "pdfium_fuzzer_helper.cc",
+ "pdfium_fuzzer_helper.h",
+ ]
+ deps = [
+ "../../:pdfium",
+ "../../:test_support",
+ ]
+ if (defined(invoker.deps)) {
+ deps += invoker.deps
+ }
+ testonly = true
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":fuzzer_config",
+ ]
+ if (pdf_enable_v8) {
+ configs += [ "//v8:external_startup_data" ]
+ deps += [
+ "//v8",
+ "//v8:v8_libplatform",
+ ]
+ }
+ }
+}
+
template("pdfium_fuzzer") {
source_set(target_name) {
sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
deps = [
- "../..:pdfium",
+ "../../:pdfium",
]
if (defined(invoker.deps)) {
deps += invoker.deps
@@ -181,17 +210,10 @@ if (pdf_enable_xfa) {
]
}
- pdfium_fuzzer("pdfium_xfa_fuzzer_src") {
+ pdfium_public_fuzzer("pdfium_xfa_fuzzer_src") {
sources = [
- "pdfium_fuzzer_helper.cc",
- "pdfium_fuzzer_helper.h",
"pdfium_xfa_fuzzer.cc",
]
- deps = [
- "../../:test_support",
- "//v8",
- "//v8:v8_libplatform",
- ]
}
}
@@ -270,21 +292,8 @@ pdfium_fuzzer("pdf_xml_fuzzer_src") {
]
}
-pdfium_fuzzer("pdfium_fuzzer_src") {
+pdfium_public_fuzzer("pdfium_fuzzer_src") {
sources = [
"pdfium_fuzzer.cc",
- "pdfium_fuzzer_helper.cc",
- "pdfium_fuzzer_helper.h",
]
-
- deps = [
- "../../:test_support",
- ]
-
- if (pdf_enable_v8) {
- deps += [
- "//v8",
- "//v8:v8_libplatform",
- ]
- }
}