diff options
author | Oliver Chang <ochang@chromium.org> | 2016-02-16 11:42:07 -0800 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2016-02-16 11:42:07 -0800 |
commit | e67d21825c9fd4b805b9bea211e09225f3c2a85d (patch) | |
tree | 992a03762cedc49b2d1b60054be1a81ecb0d0f77 /testing/libfuzzer/BUILD.gn | |
parent | 5f554133283d03b6b30bcecfcdc689cccf3799ec (diff) | |
download | pdfium-e67d21825c9fd4b805b9bea211e09225f3c2a85d.tar.xz |
Add initial libfuzzers for fm2js transpiling and XML parsing.
GN source_sets are added so that the fuzzers can be built from
//testing/libfuzzer in a Chromium checkout.
GYP targets are also added to make sure these always build properly on
our waterfall. These don't actually build the proper libfuzzers, but
build the target fuzz function with a driver main() since the actual
build process is quite complicated.
R=tsepez@chromium.org, thestig@chromium.org
BUG=587126
Review URL: https://codereview.chromium.org/1701103002 .
Diffstat (limited to 'testing/libfuzzer/BUILD.gn')
-rw-r--r-- | testing/libfuzzer/BUILD.gn | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/libfuzzer/BUILD.gn b/testing/libfuzzer/BUILD.gn new file mode 100644 index 0000000000..46cf0589d3 --- /dev/null +++ b/testing/libfuzzer/BUILD.gn @@ -0,0 +1,51 @@ +# Copyright 2016 The PDFium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../../pdfium.gni") + +config("libfuzzer_config") { + defines = [ + "PNG_PREFIX", + "PNGPREFIX_H", + "PNG_USE_READ_MACROS", + ] + include_dirs = [ "../.." ] + if (pdf_enable_v8) { + defines += [ "PDF_ENABLE_V8" ] + } + if (pdf_enable_xfa) { + defines += [ "PDF_ENABLE_XFA" ] + } +} + +if (pdf_enable_xfa) { + source_set("pdf_fm2js_fuzzer") { + testonly = true + sources = [ + "pdf_fm2js_fuzzer.cc", + ] + deps = [ + "//third_party/pdfium:pdfium", + ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ + "//build/config/compiler:no_chromium_code", + ":libfuzzer_config", + ] + } + source_set("pdf_xml_fuzzer") { + testonly = true + sources = [ + "pdf_xml_fuzzer.cc", + ] + deps = [ + "//third_party/pdfium:pdfium", + ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ + "//build/config/compiler:no_chromium_code", + ":libfuzzer_config", + ] + } +} |