Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 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 | |
Oliver Chang | 17e920d | 2015-11-18 09:26:28 -0800 | [diff] [blame] | 5 | import("//build/config/sanitizers/sanitizers.gni") |
dsinclair | 038bf0b | 2016-04-30 06:00:05 -0700 | [diff] [blame] | 6 | import("../pdfium.gni") |
Tom Sepez | a8a39e2 | 2015-10-12 15:47:07 -0700 | [diff] [blame] | 7 | |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 8 | group("samples") { |
Tom Sepez | d831dc7 | 2015-10-19 16:04:22 -0700 | [diff] [blame] | 9 | testonly = true |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 10 | deps = [ |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 11 | ":pdfium_test", |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 12 | ] |
| 13 | } |
| 14 | |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 15 | config("pdfium_samples_config") { |
dsinclair | 6e162b5 | 2017-01-24 11:18:16 -0800 | [diff] [blame] | 16 | cflags = [] |
| 17 | ldflags = [] |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 18 | defines = [ |
| 19 | "PNG_PREFIX", |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 20 | "PNG_USE_READ_MACROS", |
| 21 | ] |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 22 | include_dirs = [ ".." ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 23 | if (pdf_enable_v8) { |
Tom Sepez | d87b20e | 2016-03-02 16:55:26 -0800 | [diff] [blame] | 24 | defines += [ "PDF_ENABLE_V8" ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 25 | } |
Tom Sepez | a8a39e2 | 2015-10-12 15:47:07 -0700 | [diff] [blame] | 26 | if (pdf_enable_xfa) { |
Tom Sepez | d87b20e | 2016-03-02 16:55:26 -0800 | [diff] [blame] | 27 | defines += [ "PDF_ENABLE_XFA" ] |
Tom Sepez | a8a39e2 | 2015-10-12 15:47:07 -0700 | [diff] [blame] | 28 | } |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 29 | if (pdf_use_skia) { |
| 30 | defines += [ "PDF_ENABLE_SKIA" ] |
| 31 | } |
dan sinclair | 00d4064 | 2017-01-30 19:48:54 -0800 | [diff] [blame] | 32 | if (is_asan) { |
| 33 | defines += [ "PDF_ENABLE_ASAN" ] |
| 34 | } |
Henrique Nakashima | 95ea778 | 2017-07-11 16:42:43 -0400 | [diff] [blame] | 35 | |
| 36 | if (enable_callgrind) { |
| 37 | defines += [ "ENABLE_CALLGRIND" ] |
| 38 | } |
| 39 | |
dsinclair | 6e162b5 | 2017-01-24 11:18:16 -0800 | [diff] [blame] | 40 | if (use_coverage && is_clang) { |
| 41 | cflags += [ |
| 42 | "--coverage", |
| 43 | "-g", |
| 44 | "-O0", |
| 45 | ] |
| 46 | ldflags += [ "--coverage" ] |
| 47 | } |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 48 | } |
| 49 | |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 50 | executable("pdfium_test") { |
Tom Sepez | d831dc7 | 2015-10-19 16:04:22 -0700 | [diff] [blame] | 51 | testonly = true |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 52 | sources = [ |
Tom Sepez | d87b20e | 2016-03-02 16:55:26 -0800 | [diff] [blame] | 53 | "pdfium_test.cc", |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 54 | ] |
| 55 | deps = [ |
Lei Zhang | 143959d | 2017-06-22 12:20:58 -0700 | [diff] [blame] | 56 | "../:image_diff", |
dsinclair | 685bb88 | 2016-04-20 07:32:39 -0700 | [diff] [blame] | 57 | "../:pdfium", |
| 58 | "../:test_support", |
Tom Anderson | 2264473 | 2017-05-18 17:12:43 -0700 | [diff] [blame] | 59 | "//build/config:exe_and_shlib_deps", |
brucedawson | 15bfe1b | 2016-04-27 15:28:41 -0700 | [diff] [blame] | 60 | "//build/win:default_exe_manifest", |
John Abd-El-Malek | b045ed2 | 2015-02-10 09:15:12 -0800 | [diff] [blame] | 61 | ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 62 | if (pdf_enable_v8) { |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 63 | deps += [ "//v8:v8_libplatform" ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 64 | include_dirs = [ |
| 65 | "//v8", |
| 66 | "//v8/include", |
| 67 | ] |
Jochen Eisinger | 7ed503d | 2015-12-10 14:38:06 +0100 | [diff] [blame] | 68 | configs += [ "//v8:external_startup_data" ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 69 | } |
caryclark | af177fe | 2016-11-16 10:10:03 -0800 | [diff] [blame] | 70 | if (pdf_use_skia || pdf_use_skia_paths) { |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 71 | deps += [ "//skia" ] |
| 72 | } |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 73 | configs += [ ":pdfium_samples_config" ] |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 74 | } |