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 = [ ".." ] |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 23 | if (pdf_use_skia) { |
| 24 | defines += [ "PDF_ENABLE_SKIA" ] |
Lei Zhang | 2cb8f85 | 2019-09-16 19:39:16 +0000 | [diff] [blame] | 25 | } else if (pdf_use_skia_paths) { |
| 26 | defines += [ "PDF_ENABLE_SKIA_PATHS" ] |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 27 | } |
dan sinclair | 00d4064 | 2017-01-30 19:48:54 -0800 | [diff] [blame] | 28 | if (is_asan) { |
| 29 | defines += [ "PDF_ENABLE_ASAN" ] |
| 30 | } |
Henrique Nakashima | 95ea778 | 2017-07-11 16:42:43 -0400 | [diff] [blame] | 31 | |
| 32 | if (enable_callgrind) { |
| 33 | defines += [ "ENABLE_CALLGRIND" ] |
| 34 | } |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 35 | } |
| 36 | |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 37 | executable("pdfium_test") { |
Tom Sepez | d831dc7 | 2015-10-19 16:04:22 -0700 | [diff] [blame] | 38 | testonly = true |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 39 | sources = [ |
Tom Sepez | d87b20e | 2016-03-02 16:55:26 -0800 | [diff] [blame] | 40 | "pdfium_test.cc", |
Dan Sinclair | cb87682 | 2018-03-22 16:21:04 +0000 | [diff] [blame] | 41 | "pdfium_test_dump_helper.cc", |
| 42 | "pdfium_test_dump_helper.h", |
| 43 | "pdfium_test_event_helper.cc", |
| 44 | "pdfium_test_event_helper.h", |
| 45 | "pdfium_test_write_helper.cc", |
| 46 | "pdfium_test_write_helper.h", |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 47 | ] |
Lei Zhang | b82b2df | 2019-05-31 22:41:06 +0000 | [diff] [blame] | 48 | |
| 49 | # Note: One should write programs that depend on ../:pdfium. Whereas this |
| 50 | # sample program does not set a good example, and depends on PDFium internals, |
| 51 | # as well as test support code, for convenience. |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 52 | deps = [ |
Lei Zhang | b82b2df | 2019-05-31 22:41:06 +0000 | [diff] [blame] | 53 | "../:pdfium_public_headers", |
| 54 | "../fpdfsdk", |
Lei Zhang | 76833a6 | 2018-10-12 18:53:17 +0000 | [diff] [blame] | 55 | "../testing/:test_support", |
| 56 | "../testing/image_diff", |
Lei Zhang | b82b2df | 2019-05-31 22:41:06 +0000 | [diff] [blame] | 57 | "../third_party:pdfium_base", |
brucedawson | 15bfe1b | 2016-04-27 15:28:41 -0700 | [diff] [blame] | 58 | "//build/win:default_exe_manifest", |
John Abd-El-Malek | b045ed2 | 2015-02-10 09:15:12 -0800 | [diff] [blame] | 59 | ] |
Lei Zhang | 360edeb | 2017-12-19 18:06:35 +0000 | [diff] [blame] | 60 | configs += [ ":pdfium_samples_config" ] |
| 61 | |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 62 | if (pdf_enable_v8) { |
Lei Zhang | bfc5f60 | 2018-10-11 19:28:08 +0000 | [diff] [blame] | 63 | deps += [ |
| 64 | "//v8:v8_headers", |
| 65 | "//v8:v8_libplatform", |
| 66 | ] |
Lei Zhang | 76833a6 | 2018-10-12 18:53:17 +0000 | [diff] [blame] | 67 | include_dirs = [ "//v8" ] |
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 | } |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 73 | } |