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", |
John Abd-El-Malek | b045ed2 | 2015-02-10 09:15:12 -0800 | [diff] [blame] | 58 | ] |
Tom Sepez | d2e023b | 2015-12-08 14:36:16 -0800 | [diff] [blame] | 59 | if (!pdf_enable_xfa) { |
| 60 | deps += [ "../third_party:fx_lpng" ] |
| 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 | } |
Tom Sepez | af18cb3 | 2015-02-05 15:06:01 -0800 | [diff] [blame] | 75 | |
| 76 | executable("pdfium_diff") { |
Tom Sepez | d831dc7 | 2015-10-19 16:04:22 -0700 | [diff] [blame] | 77 | testonly = true |
Tom Sepez | af18cb3 | 2015-02-05 15:06:01 -0800 | [diff] [blame] | 78 | sources = [ |
| 79 | "image_diff.cc", |
| 80 | "image_diff_png.cc", |
| 81 | "image_diff_png.h", |
| 82 | ] |
| 83 | deps = [ |
dsinclair | 685bb88 | 2016-04-20 07:32:39 -0700 | [diff] [blame] | 84 | "../:pdfium", |
Oliver Chang | 17e920d | 2015-11-18 09:26:28 -0800 | [diff] [blame] | 85 | "//build/config/sanitizers:deps", |
brucedawson | 15bfe1b | 2016-04-27 15:28:41 -0700 | [diff] [blame] | 86 | "//build/win:default_exe_manifest", |
Tom Sepez | af18cb3 | 2015-02-05 15:06:01 -0800 | [diff] [blame] | 87 | ] |
Tom Sepez | d2e023b | 2015-12-08 14:36:16 -0800 | [diff] [blame] | 88 | if (!pdf_enable_xfa) { |
| 89 | deps += [ "../third_party:fx_lpng" ] |
| 90 | } |
Lei Zhang | 461b634 | 2015-11-06 10:32:28 -0800 | [diff] [blame] | 91 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 92 | configs += [ |
| 93 | ":pdfium_samples_config", |
| 94 | "//build/config/compiler:no_chromium_code", |
| 95 | ] |
John Abd-El-Malek | b045ed2 | 2015-02-10 09:15:12 -0800 | [diff] [blame] | 96 | } |