summaryrefslogtreecommitdiff
path: root/testing/libfuzzer/BUILD.gn
blob: bd6215ba1a4ae348951da461694ddbd8cb7097c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 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("//build_overrides/pdfium.gni")

config("libfuzzer_config") {
  defines = [
    "PNG_PREFIX",
    "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",
    ]
  }
}

source_set("pdf_jpx_fuzzer") {
  testonly = true
  sources = [
    "pdf_jpx_fuzzer.cc",
  ]
  deps = [
    "//third_party/pdfium:pdfium",
  ]
  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [
    "//build/config/compiler:no_chromium_code",
    ":libfuzzer_config",
  ]
}