blob: d658a33cf8fd3c08aa637f9ac9b19dc3d2edca6e [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 = [
Lei Zhang461b6342015-11-06 10:32:28 -080011 ":pdfium_diff",
Cary Clark399be5b2016-03-14 16:51:29 -040012 ":pdfium_test",
Tom Sepez65edf592014-11-13 17:04:15 -080013 ]
14}
15
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080016config("pdfium_samples_config") {
dsinclair6e162b52017-01-24 11:18:16 -080017 cflags = []
18 ldflags = []
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080019 defines = [
20 "PNG_PREFIX",
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080021 "PNG_USE_READ_MACROS",
22 ]
Lei Zhang461b6342015-11-06 10:32:28 -080023 include_dirs = [ ".." ]
Tom Sepez452b4f32015-10-13 09:27:27 -070024 if (pdf_enable_v8) {
Tom Sepezd87b20e2016-03-02 16:55:26 -080025 defines += [ "PDF_ENABLE_V8" ]
Tom Sepez452b4f32015-10-13 09:27:27 -070026 }
Tom Sepeza8a39e22015-10-12 15:47:07 -070027 if (pdf_enable_xfa) {
Tom Sepezd87b20e2016-03-02 16:55:26 -080028 defines += [ "PDF_ENABLE_XFA" ]
Tom Sepeza8a39e22015-10-12 15:47:07 -070029 }
Cary Clark399be5b2016-03-14 16:51:29 -040030 if (pdf_use_skia) {
31 defines += [ "PDF_ENABLE_SKIA" ]
32 }
dan sinclair00d40642017-01-30 19:48:54 -080033 if (is_asan) {
34 defines += [ "PDF_ENABLE_ASAN" ]
35 }
dsinclair6e162b52017-01-24 11:18:16 -080036 if (use_coverage && is_clang) {
37 cflags += [
38 "--coverage",
39 "-g",
40 "-O0",
41 ]
42 ldflags += [ "--coverage" ]
43 }
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080044}
45
Tom Sepez65edf592014-11-13 17:04:15 -080046executable("pdfium_test") {
Tom Sepezd831dc72015-10-19 16:04:22 -070047 testonly = true
Tom Sepez65edf592014-11-13 17:04:15 -080048 sources = [
Tom Sepezd2e023b2015-12-08 14:36:16 -080049 "image_diff_png.cc",
50 "image_diff_png.h",
Tom Sepezd87b20e2016-03-02 16:55:26 -080051 "pdfium_test.cc",
Tom Sepez65edf592014-11-13 17:04:15 -080052 ]
53 deps = [
dsinclair685bb882016-04-20 07:32:39 -070054 "../:pdfium",
55 "../:test_support",
Oliver Chang17e920d2015-11-18 09:26:28 -080056 "//build/config/sanitizers:deps",
brucedawson15bfe1b2016-04-27 15:28:41 -070057 "//build/win:default_exe_manifest",
John Abd-El-Malekb045ed22015-02-10 09:15:12 -080058 ]
Tom Sepezd2e023b2015-12-08 14:36:16 -080059 if (!pdf_enable_xfa) {
60 deps += [ "../third_party:fx_lpng" ]
61 }
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}
Tom Sepezaf18cb32015-02-05 15:06:01 -080075
76executable("pdfium_diff") {
Tom Sepezd831dc72015-10-19 16:04:22 -070077 testonly = true
Tom Sepezaf18cb32015-02-05 15:06:01 -080078 sources = [
79 "image_diff.cc",
80 "image_diff_png.cc",
81 "image_diff_png.h",
82 ]
83 deps = [
dsinclair685bb882016-04-20 07:32:39 -070084 "../:pdfium",
Oliver Chang17e920d2015-11-18 09:26:28 -080085 "//build/config/sanitizers:deps",
brucedawson15bfe1b2016-04-27 15:28:41 -070086 "//build/win:default_exe_manifest",
Tom Sepezaf18cb32015-02-05 15:06:01 -080087 ]
Tom Sepezd2e023b2015-12-08 14:36:16 -080088 if (!pdf_enable_xfa) {
89 deps += [ "../third_party:fx_lpng" ]
90 }
Lei Zhang461b6342015-11-06 10:32:28 -080091 configs -= [ "//build/config/compiler:chromium_code" ]
92 configs += [
93 ":pdfium_samples_config",
94 "//build/config/compiler:no_chromium_code",
95 ]
John Abd-El-Malekb045ed22015-02-10 09:15:12 -080096}