blob: 8fbf5d552f3c13f466411ba9bd1ee07ab5b0a4c3 [file] [log] [blame]
Tom Sepez65edf592014-11-13 17:04:15 -08001# 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 Chang17e920d2015-11-18 09:26:28 -08005import("//build/config/sanitizers/sanitizers.gni")
dsinclair038bf0b2016-04-30 06:00:05 -07006import("../pdfium.gni")
Tom Sepeza8a39e22015-10-12 15:47:07 -07007
Tom Sepez65edf592014-11-13 17:04:15 -08008group("samples") {
Tom Sepezd831dc72015-10-19 16:04:22 -07009 testonly = true
Tom Sepez65edf592014-11-13 17:04:15 -080010 deps = [
Cary Clark399be5b2016-03-14 16:51:29 -040011 ":pdfium_test",
Tom Sepez65edf592014-11-13 17:04:15 -080012 ]
13}
14
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080015config("pdfium_samples_config") {
dsinclair6e162b52017-01-24 11:18:16 -080016 cflags = []
17 ldflags = []
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080018 defines = [
19 "PNG_PREFIX",
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080020 "PNG_USE_READ_MACROS",
21 ]
Lei Zhang461b6342015-11-06 10:32:28 -080022 include_dirs = [ ".." ]
Tom Sepez452b4f32015-10-13 09:27:27 -070023 if (pdf_enable_v8) {
Tom Sepezd87b20e2016-03-02 16:55:26 -080024 defines += [ "PDF_ENABLE_V8" ]
Tom Sepez452b4f32015-10-13 09:27:27 -070025 }
Tom Sepeza8a39e22015-10-12 15:47:07 -070026 if (pdf_enable_xfa) {
Tom Sepezd87b20e2016-03-02 16:55:26 -080027 defines += [ "PDF_ENABLE_XFA" ]
Tom Sepeza8a39e22015-10-12 15:47:07 -070028 }
Cary Clark399be5b2016-03-14 16:51:29 -040029 if (pdf_use_skia) {
30 defines += [ "PDF_ENABLE_SKIA" ]
31 }
dan sinclair00d40642017-01-30 19:48:54 -080032 if (is_asan) {
33 defines += [ "PDF_ENABLE_ASAN" ]
34 }
Henrique Nakashima95ea7782017-07-11 16:42:43 -040035
36 if (enable_callgrind) {
37 defines += [ "ENABLE_CALLGRIND" ]
38 }
39
dsinclair6e162b52017-01-24 11:18:16 -080040 if (use_coverage && is_clang) {
41 cflags += [
42 "--coverage",
43 "-g",
44 "-O0",
45 ]
46 ldflags += [ "--coverage" ]
47 }
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080048}
49
Tom Sepez65edf592014-11-13 17:04:15 -080050executable("pdfium_test") {
Tom Sepezd831dc72015-10-19 16:04:22 -070051 testonly = true
Tom Sepez65edf592014-11-13 17:04:15 -080052 sources = [
Tom Sepezd87b20e2016-03-02 16:55:26 -080053 "pdfium_test.cc",
Tom Sepez65edf592014-11-13 17:04:15 -080054 ]
55 deps = [
Lei Zhang143959d2017-06-22 12:20:58 -070056 "../:image_diff",
dsinclair685bb882016-04-20 07:32:39 -070057 "../:pdfium",
58 "../:test_support",
Tom Anderson22644732017-05-18 17:12:43 -070059 "//build/config:exe_and_shlib_deps",
brucedawson15bfe1b2016-04-27 15:28:41 -070060 "//build/win:default_exe_manifest",
John Abd-El-Malekb045ed22015-02-10 09:15:12 -080061 ]
Tom Sepez452b4f32015-10-13 09:27:27 -070062 if (pdf_enable_v8) {
Lei Zhang461b6342015-11-06 10:32:28 -080063 deps += [ "//v8:v8_libplatform" ]
Tom Sepez452b4f32015-10-13 09:27:27 -070064 include_dirs = [
65 "//v8",
66 "//v8/include",
67 ]
Jochen Eisinger7ed503d2015-12-10 14:38:06 +010068 configs += [ "//v8:external_startup_data" ]
Tom Sepez452b4f32015-10-13 09:27:27 -070069 }
caryclarkaf177fe2016-11-16 10:10:03 -080070 if (pdf_use_skia || pdf_use_skia_paths) {
Cary Clark399be5b2016-03-14 16:51:29 -040071 deps += [ "//skia" ]
72 }
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080073 configs += [ ":pdfium_samples_config" ]
Tom Sepez65edf592014-11-13 17:04:15 -080074}