blob: 5b90f604512f227687ee9db551b23332bac27a19 [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 = [ ".." ]
Cary Clark399be5b2016-03-14 16:51:29 -040023 if (pdf_use_skia) {
24 defines += [ "PDF_ENABLE_SKIA" ]
Lei Zhang2cb8f852019-09-16 19:39:16 +000025 } else if (pdf_use_skia_paths) {
26 defines += [ "PDF_ENABLE_SKIA_PATHS" ]
Cary Clark399be5b2016-03-14 16:51:29 -040027 }
dan sinclair00d40642017-01-30 19:48:54 -080028 if (is_asan) {
29 defines += [ "PDF_ENABLE_ASAN" ]
30 }
Henrique Nakashima95ea7782017-07-11 16:42:43 -040031
32 if (enable_callgrind) {
33 defines += [ "ENABLE_CALLGRIND" ]
34 }
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080035}
36
Tom Sepez65edf592014-11-13 17:04:15 -080037executable("pdfium_test") {
Tom Sepezd831dc72015-10-19 16:04:22 -070038 testonly = true
Tom Sepez65edf592014-11-13 17:04:15 -080039 sources = [
Tom Sepezd87b20e2016-03-02 16:55:26 -080040 "pdfium_test.cc",
Dan Sinclaircb876822018-03-22 16:21:04 +000041 "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 Sepez65edf592014-11-13 17:04:15 -080047 ]
Lei Zhangb82b2df2019-05-31 22:41:06 +000048
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 Sepez65edf592014-11-13 17:04:15 -080052 deps = [
Lei Zhangb82b2df2019-05-31 22:41:06 +000053 "../:pdfium_public_headers",
54 "../fpdfsdk",
Lei Zhang76833a62018-10-12 18:53:17 +000055 "../testing/:test_support",
56 "../testing/image_diff",
Lei Zhangb82b2df2019-05-31 22:41:06 +000057 "../third_party:pdfium_base",
brucedawson15bfe1b2016-04-27 15:28:41 -070058 "//build/win:default_exe_manifest",
John Abd-El-Malekb045ed22015-02-10 09:15:12 -080059 ]
Lei Zhang360edeb2017-12-19 18:06:35 +000060 configs += [ ":pdfium_samples_config" ]
61
Tom Sepez452b4f32015-10-13 09:27:27 -070062 if (pdf_enable_v8) {
Lei Zhangbfc5f602018-10-11 19:28:08 +000063 deps += [
64 "//v8:v8_headers",
65 "//v8:v8_libplatform",
66 ]
Lei Zhang76833a62018-10-12 18:53:17 +000067 include_dirs = [ "//v8" ]
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 }
Tom Sepez65edf592014-11-13 17:04:15 -080073}