• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2014 PDFium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/sanitizers/sanitizers.gni")
6import("../pdfium.gni")
7
8group("samples") {
9  testonly = true
10  deps = [ ":pdfium_test" ]
11}
12
13config("pdfium_samples_config") {
14  cflags = []
15  ldflags = []
16  defines = [
17    "PNG_PREFIX",
18    "PNG_USE_READ_MACROS",
19  ]
20  include_dirs = [ ".." ]
21  if (pdf_use_skia) {
22    defines += [ "PDF_ENABLE_SKIA" ]
23  } else if (pdf_use_skia_paths) {
24    defines += [ "PDF_ENABLE_SKIA_PATHS" ]
25  }
26  if (is_asan) {
27    defines += [ "PDF_ENABLE_ASAN" ]
28  }
29
30  if (enable_callgrind) {
31    defines += [ "ENABLE_CALLGRIND" ]
32  }
33}
34
35executable("pdfium_test") {
36  testonly = true
37  sources = [
38    "pdfium_test.cc",
39    "pdfium_test_dump_helper.cc",
40    "pdfium_test_dump_helper.h",
41    "pdfium_test_event_helper.cc",
42    "pdfium_test_event_helper.h",
43    "pdfium_test_write_helper.cc",
44    "pdfium_test_write_helper.h",
45  ]
46
47  # Note: One should write programs that depend on ../:pdfium. Whereas this
48  # sample program does not set a good example, and depends on PDFium internals,
49  # as well as test support code, for convenience.
50  deps = [
51    "../:pdfium_public_headers",
52    "../fpdfsdk",
53    "../testing/:test_support",
54    "../testing/image_diff",
55    "../third_party:pdfium_base",
56    "//build/win:default_exe_manifest",
57  ]
58  configs += [ ":pdfium_samples_config" ]
59
60  if (pdf_enable_v8) {
61    deps += [
62      "//v8:v8_headers",
63      "//v8:v8_libplatform",
64    ]
65    include_dirs = [ "//v8" ]
66    configs += [ "//v8:external_startup_data" ]
67  }
68  if (pdf_use_skia || pdf_use_skia_paths) {
69    deps += [ "//skia" ]
70  }
71}
72