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 5 import("//build/config/sanitizers/sanitizers.gni") 6 import("../pdfium.gni") 7 8 group("samples") { 9 testonly = true 10 deps = [ 11 ":pdfium_test", 12 ] 13 } 14 15 config("pdfium_samples_config") { 16 cflags = [] 17 ldflags = [] 18 defines = [ 19 "PNG_PREFIX", 20 "PNG_USE_READ_MACROS", 21 ] 22 include_dirs = [ ".." ] 23 if (pdf_enable_v8) { 24 defines += [ "PDF_ENABLE_V8" ] 25 } 26 if (pdf_enable_xfa) { 27 defines += [ "PDF_ENABLE_XFA" ] 28 } 29 if (pdf_use_skia) { 30 defines += [ "PDF_ENABLE_SKIA" ] 31 } 32 if (is_asan) { 33 defines += [ "PDF_ENABLE_ASAN" ] 34 } 35 36 if (enable_callgrind) { 37 defines += [ "ENABLE_CALLGRIND" ] 38 } 39 40 if (use_coverage && is_clang) { 41 cflags += [ 42 "--coverage", 43 "-g", 44 "-O0", 45 ] 46 ldflags += [ "--coverage" ] 47 } 48 } 49 50 executable("pdfium_test") { 51 testonly = true 52 sources = [ 53 "pdfium_test.cc", 54 ] 55 deps = [ 56 "../:image_diff", 57 "../:pdfium", 58 "../:test_support", 59 "//build/config:exe_and_shlib_deps", 60 "//build/win:default_exe_manifest", 61 ] 62 configs += [ ":pdfium_samples_config" ] 63 64 if (pdf_enable_v8) { 65 deps += [ "//v8:v8_libplatform" ] 66 include_dirs = [ 67 "//v8", 68 "//v8/include", 69 ] 70 configs += [ "//v8:external_startup_data" ] 71 } 72 if (pdf_use_skia || pdf_use_skia_paths) { 73 deps += [ "//skia" ] 74 } 75 } 76