blob: 83c510d7c86887c5f29ebb1284c69d827cf5ec40 [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")
Jochen Eisinger7ed503d2015-12-10 14:38:06 +01006import("//build_overrides/v8.gni")
Tom Sepeza8a39e22015-10-12 15:47:07 -07007import("../pdfium.gni")
8
Tom Sepez65edf592014-11-13 17:04:15 -08009group("samples") {
Tom Sepezd831dc72015-10-19 16:04:22 -070010 testonly = true
Tom Sepez65edf592014-11-13 17:04:15 -080011 deps = [
Lei Zhang461b6342015-11-06 10:32:28 -080012 ":pdfium_diff",
Cary Clark399be5b2016-03-14 16:51:29 -040013 ":pdfium_test",
Tom Sepez65edf592014-11-13 17:04:15 -080014 ]
15}
16
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080017config("pdfium_samples_config") {
18 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 }
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080032}
33
Tom Sepez65edf592014-11-13 17:04:15 -080034executable("pdfium_test") {
Tom Sepezd831dc72015-10-19 16:04:22 -070035 testonly = true
Tom Sepez65edf592014-11-13 17:04:15 -080036 sources = [
Tom Sepezd2e023b2015-12-08 14:36:16 -080037 "image_diff_png.cc",
38 "image_diff_png.h",
Tom Sepezd87b20e2016-03-02 16:55:26 -080039 "pdfium_test.cc",
Tom Sepez65edf592014-11-13 17:04:15 -080040 ]
41 deps = [
dsinclair685bb882016-04-20 07:32:39 -070042 "../:pdfium",
43 "../:test_support",
Oliver Chang17e920d2015-11-18 09:26:28 -080044 "//build/config/sanitizers:deps",
Lei Zhang461b6342015-11-06 10:32:28 -080045
46 # Regardless of whether the library ships against system freetype,
47 # always link this binary against the bundled one for consistency
48 # of results across platforms.
dsinclair685bb882016-04-20 07:32:39 -070049 "../third_party:fx_freetype",
John Abd-El-Malekb045ed22015-02-10 09:15:12 -080050 ]
Tom Sepezd2e023b2015-12-08 14:36:16 -080051 if (!pdf_enable_xfa) {
52 deps += [ "../third_party:fx_lpng" ]
53 }
Tom Sepez452b4f32015-10-13 09:27:27 -070054 if (pdf_enable_v8) {
Lei Zhang461b6342015-11-06 10:32:28 -080055 deps += [ "//v8:v8_libplatform" ]
Tom Sepez452b4f32015-10-13 09:27:27 -070056 include_dirs = [
57 "//v8",
58 "//v8/include",
59 ]
Jochen Eisinger7ed503d2015-12-10 14:38:06 +010060 configs += [ "//v8:external_startup_data" ]
Tom Sepez452b4f32015-10-13 09:27:27 -070061 }
Cary Clark399be5b2016-03-14 16:51:29 -040062 if (pdf_use_skia) {
63 deps += [ "//skia" ]
64 }
John Abd-El-Malekca6c0d32015-02-17 13:26:45 -080065 configs += [ ":pdfium_samples_config" ]
Tom Sepez65edf592014-11-13 17:04:15 -080066}
Tom Sepezaf18cb32015-02-05 15:06:01 -080067
68executable("pdfium_diff") {
Tom Sepezd831dc72015-10-19 16:04:22 -070069 testonly = true
Tom Sepezaf18cb32015-02-05 15:06:01 -080070 sources = [
71 "image_diff.cc",
72 "image_diff_png.cc",
73 "image_diff_png.h",
74 ]
75 deps = [
dsinclair685bb882016-04-20 07:32:39 -070076 "../:pdfium",
Oliver Chang17e920d2015-11-18 09:26:28 -080077 "//build/config/sanitizers:deps",
Tom Sepezaf18cb32015-02-05 15:06:01 -080078 ]
Tom Sepezd2e023b2015-12-08 14:36:16 -080079 if (!pdf_enable_xfa) {
80 deps += [ "../third_party:fx_lpng" ]
81 }
Lei Zhang461b6342015-11-06 10:32:28 -080082 configs -= [ "//build/config/compiler:chromium_code" ]
83 configs += [
84 ":pdfium_samples_config",
85 "//build/config/compiler:no_chromium_code",
86 ]
John Abd-El-Malekb045ed22015-02-10 09:15:12 -080087}