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 = [ |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 11 | ":pdfium_diff", |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 12 | ":pdfium_test", |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 13 | ] |
| 14 | } |
| 15 | |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 16 | config("pdfium_samples_config") { |
dsinclair | 6e162b5 | 2017-01-24 11:18:16 -0800 | [diff] [blame] | 17 | cflags = [] |
| 18 | ldflags = [] |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 19 | defines = [ |
| 20 | "PNG_PREFIX", |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 21 | "PNG_USE_READ_MACROS", |
| 22 | ] |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 23 | include_dirs = [ ".." ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 24 | if (pdf_enable_v8) { |
Tom Sepez | d87b20e | 2016-03-02 16:55:26 -0800 | [diff] [blame] | 25 | defines += [ "PDF_ENABLE_V8" ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 26 | } |
Tom Sepez | a8a39e2 | 2015-10-12 15:47:07 -0700 | [diff] [blame] | 27 | if (pdf_enable_xfa) { |
Tom Sepez | d87b20e | 2016-03-02 16:55:26 -0800 | [diff] [blame] | 28 | defines += [ "PDF_ENABLE_XFA" ] |
Tom Sepez | a8a39e2 | 2015-10-12 15:47:07 -0700 | [diff] [blame] | 29 | } |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 30 | if (pdf_use_skia) { |
| 31 | defines += [ "PDF_ENABLE_SKIA" ] |
| 32 | } |
dan sinclair | 00d4064 | 2017-01-30 19:48:54 -0800 | [diff] [blame^] | 33 | if (is_asan) { |
| 34 | defines += [ "PDF_ENABLE_ASAN" ] |
| 35 | } |
dsinclair | 6e162b5 | 2017-01-24 11:18:16 -0800 | [diff] [blame] | 36 | if (use_coverage && is_clang) { |
| 37 | cflags += [ |
| 38 | "--coverage", |
| 39 | "-g", |
| 40 | "-O0", |
| 41 | ] |
| 42 | ldflags += [ "--coverage" ] |
| 43 | } |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 44 | } |
| 45 | |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 46 | executable("pdfium_test") { |
Tom Sepez | d831dc7 | 2015-10-19 16:04:22 -0700 | [diff] [blame] | 47 | testonly = true |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 48 | sources = [ |
Tom Sepez | d2e023b | 2015-12-08 14:36:16 -0800 | [diff] [blame] | 49 | "image_diff_png.cc", |
| 50 | "image_diff_png.h", |
Tom Sepez | d87b20e | 2016-03-02 16:55:26 -0800 | [diff] [blame] | 51 | "pdfium_test.cc", |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 52 | ] |
| 53 | deps = [ |
dsinclair | 685bb88 | 2016-04-20 07:32:39 -0700 | [diff] [blame] | 54 | "../:pdfium", |
| 55 | "../:test_support", |
Oliver Chang | 17e920d | 2015-11-18 09:26:28 -0800 | [diff] [blame] | 56 | "//build/config/sanitizers:deps", |
brucedawson | 15bfe1b | 2016-04-27 15:28:41 -0700 | [diff] [blame] | 57 | "//build/win:default_exe_manifest", |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 58 | |
| 59 | # Regardless of whether the library ships against system freetype, |
| 60 | # always link this binary against the bundled one for consistency |
| 61 | # of results across platforms. |
dsinclair | 685bb88 | 2016-04-20 07:32:39 -0700 | [diff] [blame] | 62 | "../third_party:fx_freetype", |
John Abd-El-Malek | b045ed2 | 2015-02-10 09:15:12 -0800 | [diff] [blame] | 63 | ] |
Tom Sepez | d2e023b | 2015-12-08 14:36:16 -0800 | [diff] [blame] | 64 | if (!pdf_enable_xfa) { |
| 65 | deps += [ "../third_party:fx_lpng" ] |
| 66 | } |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 67 | if (pdf_enable_v8) { |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 68 | deps += [ "//v8:v8_libplatform" ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 69 | include_dirs = [ |
| 70 | "//v8", |
| 71 | "//v8/include", |
| 72 | ] |
Jochen Eisinger | 7ed503d | 2015-12-10 14:38:06 +0100 | [diff] [blame] | 73 | configs += [ "//v8:external_startup_data" ] |
Tom Sepez | 452b4f3 | 2015-10-13 09:27:27 -0700 | [diff] [blame] | 74 | } |
caryclark | af177fe | 2016-11-16 10:10:03 -0800 | [diff] [blame] | 75 | if (pdf_use_skia || pdf_use_skia_paths) { |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 76 | deps += [ "//skia" ] |
| 77 | } |
John Abd-El-Malek | ca6c0d3 | 2015-02-17 13:26:45 -0800 | [diff] [blame] | 78 | configs += [ ":pdfium_samples_config" ] |
Tom Sepez | 65edf59 | 2014-11-13 17:04:15 -0800 | [diff] [blame] | 79 | } |
Tom Sepez | af18cb3 | 2015-02-05 15:06:01 -0800 | [diff] [blame] | 80 | |
| 81 | executable("pdfium_diff") { |
Tom Sepez | d831dc7 | 2015-10-19 16:04:22 -0700 | [diff] [blame] | 82 | testonly = true |
Tom Sepez | af18cb3 | 2015-02-05 15:06:01 -0800 | [diff] [blame] | 83 | sources = [ |
| 84 | "image_diff.cc", |
| 85 | "image_diff_png.cc", |
| 86 | "image_diff_png.h", |
| 87 | ] |
| 88 | deps = [ |
dsinclair | 685bb88 | 2016-04-20 07:32:39 -0700 | [diff] [blame] | 89 | "../:pdfium", |
Oliver Chang | 17e920d | 2015-11-18 09:26:28 -0800 | [diff] [blame] | 90 | "//build/config/sanitizers:deps", |
brucedawson | 15bfe1b | 2016-04-27 15:28:41 -0700 | [diff] [blame] | 91 | "//build/win:default_exe_manifest", |
Tom Sepez | af18cb3 | 2015-02-05 15:06:01 -0800 | [diff] [blame] | 92 | ] |
Tom Sepez | d2e023b | 2015-12-08 14:36:16 -0800 | [diff] [blame] | 93 | if (!pdf_enable_xfa) { |
| 94 | deps += [ "../third_party:fx_lpng" ] |
| 95 | } |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 96 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 97 | configs += [ |
| 98 | ":pdfium_samples_config", |
| 99 | "//build/config/compiler:no_chromium_code", |
| 100 | ] |
John Abd-El-Malek | b045ed2 | 2015-02-10 09:15:12 -0800 | [diff] [blame] | 101 | } |