xref: /aosp_15_r20/external/pdfium/core/fpdfapi/parser/BUILD.gn (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1# Copyright 2018 The PDFium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("../../../pdfium.gni")
6import("../../../testing/test.gni")
7
8source_set("parser") {
9  sources = [
10    "cfdf_document.cpp",
11    "cfdf_document.h",
12    "cpdf_array.cpp",
13    "cpdf_array.h",
14    "cpdf_boolean.cpp",
15    "cpdf_boolean.h",
16    "cpdf_cross_ref_avail.cpp",
17    "cpdf_cross_ref_avail.h",
18    "cpdf_cross_ref_table.cpp",
19    "cpdf_cross_ref_table.h",
20    "cpdf_crypto_handler.cpp",
21    "cpdf_crypto_handler.h",
22    "cpdf_data_avail.cpp",
23    "cpdf_data_avail.h",
24    "cpdf_dictionary.cpp",
25    "cpdf_dictionary.h",
26    "cpdf_document.cpp",
27    "cpdf_document.h",
28    "cpdf_encryptor.cpp",
29    "cpdf_encryptor.h",
30    "cpdf_flateencoder.cpp",
31    "cpdf_flateencoder.h",
32    "cpdf_hint_tables.cpp",
33    "cpdf_hint_tables.h",
34    "cpdf_indirect_object_holder.cpp",
35    "cpdf_indirect_object_holder.h",
36    "cpdf_linearized_header.cpp",
37    "cpdf_linearized_header.h",
38    "cpdf_name.cpp",
39    "cpdf_name.h",
40    "cpdf_null.cpp",
41    "cpdf_null.h",
42    "cpdf_number.cpp",
43    "cpdf_number.h",
44    "cpdf_object.cpp",
45    "cpdf_object.h",
46    "cpdf_object_avail.cpp",
47    "cpdf_object_avail.h",
48    "cpdf_object_stream.cpp",
49    "cpdf_object_stream.h",
50    "cpdf_object_walker.cpp",
51    "cpdf_object_walker.h",
52    "cpdf_page_object_avail.cpp",
53    "cpdf_page_object_avail.h",
54    "cpdf_parser.cpp",
55    "cpdf_parser.h",
56    "cpdf_read_validator.cpp",
57    "cpdf_read_validator.h",
58    "cpdf_reference.cpp",
59    "cpdf_reference.h",
60    "cpdf_security_handler.cpp",
61    "cpdf_security_handler.h",
62    "cpdf_simple_parser.cpp",
63    "cpdf_simple_parser.h",
64    "cpdf_stream.cpp",
65    "cpdf_stream.h",
66    "cpdf_stream_acc.cpp",
67    "cpdf_stream_acc.h",
68    "cpdf_string.cpp",
69    "cpdf_string.h",
70    "cpdf_syntax_parser.cpp",
71    "cpdf_syntax_parser.h",
72    "fpdf_parser_decode.cpp",
73    "fpdf_parser_decode.h",
74    "fpdf_parser_utility.cpp",
75    "fpdf_parser_utility.h",
76    "object_tree_traversal_util.cpp",
77    "object_tree_traversal_util.h",
78  ]
79  configs += [ "../../../:pdfium_strict_config" ]
80  deps = [
81    "../../../constants",
82    "../../fdrm",
83    "../../fxcodec",
84  ]
85  public_deps = [ "../../fxcrt" ]
86  allow_circular_includes_from = []
87  visibility = [ "../../../*" ]
88
89  if (pdf_enable_xfa) {
90    sources += [
91      "cpdf_seekablemultistream.cpp",
92      "cpdf_seekablemultistream.h",
93    ]
94  }
95  if (pdf_use_skia) {
96    deps += [ "../../fxge" ]
97    allow_circular_includes_from += [ "../../fxge" ]
98  }
99}
100
101source_set("unit_test_support") {
102  testonly = true
103  sources = [
104    "cpdf_test_document.cpp",
105    "cpdf_test_document.h",
106  ]
107  configs += [ "../../../:pdfium_strict_config" ]
108  deps = [
109    ":parser",
110    "../page",
111    "../render",
112  ]
113}
114
115pdfium_unittest_source_set("unittests") {
116  sources = [
117    "cpdf_array_unittest.cpp",
118    "cpdf_cross_ref_avail_unittest.cpp",
119    "cpdf_dictionary_unittest.cpp",
120    "cpdf_document_unittest.cpp",
121    "cpdf_hint_tables_unittest.cpp",
122    "cpdf_indirect_object_holder_unittest.cpp",
123    "cpdf_object_avail_unittest.cpp",
124    "cpdf_object_stream_unittest.cpp",
125    "cpdf_object_unittest.cpp",
126    "cpdf_object_walker_unittest.cpp",
127    "cpdf_page_object_avail_unittest.cpp",
128    "cpdf_parser_unittest.cpp",
129    "cpdf_read_validator_unittest.cpp",
130    "cpdf_simple_parser_unittest.cpp",
131    "cpdf_stream_acc_unittest.cpp",
132    "cpdf_syntax_parser_unittest.cpp",
133    "fpdf_parser_decode_unittest.cpp",
134    "fpdf_parser_utility_unittest.cpp",
135  ]
136  deps = [
137    ":parser",
138    ":unit_test_support",
139    "../../../constants",
140    "../page",
141    "../page:unit_test_support",
142    "../render",
143  ]
144  pdfium_root_dir = "../../../"
145
146  if (pdf_enable_xfa) {
147    sources += [ "cpdf_seekablemultistream_unittest.cpp" ]
148  }
149}
150
151pdfium_embeddertest_source_set("embeddertests") {
152  sources = [
153    "cpdf_parser_embeddertest.cpp",
154    "cpdf_security_handler_embeddertest.cpp",
155    "fpdf_parser_decode_embeddertest.cpp",
156    "object_tree_traversal_util_embeddertest.cpp",
157  ]
158  deps = [
159    ":parser",
160    "../../fxge",
161  ]
162  pdfium_root_dir = "../../../"
163}
164