blob: fa20e384be7c16b4b5bbe6748fd8f5bbd09d8484 [file] [log] [blame]
Lei Zhanga7dec322018-10-12 18:36:51 +00001# Copyright 2018 The 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
Lei Zhanga7dec322018-10-12 18:36:51 +00005import("../pdfium.gni")
Lei Zhangf03f7812018-10-15 23:48:29 +00006import("../testing/test.gni")
Lei Zhanga7dec322018-10-12 18:36:51 +00007
Daniel Hosseinian0fab9e62019-11-01 19:31:49 +00008source_set("fxjs") {
Lei Zhanga7dec322018-10-12 18:36:51 +00009 sources = [
10 "cjs_event_context_stub.cpp",
11 "cjs_event_context_stub.h",
12 "cjs_runtimestub.cpp",
13 "cjs_runtimestub.h",
14 "ijs_event_context.h",
15 "ijs_runtime.cpp",
16 "ijs_runtime.h",
17 ]
Lei Zhang95c396d2021-04-24 01:32:11 +000018 configs += [ "../:pdfium_strict_config" ]
Lei Zhang40f9d722020-01-24 00:18:11 +000019 deps = [ "../core/fxcrt" ]
Lei Zhang7b75fbf2021-09-28 20:35:15 +000020 public_deps = []
Lei Zhanga7dec322018-10-12 18:36:51 +000021 visibility = [ "../*" ]
22
23 if (pdf_enable_v8) {
24 sources += [
Tom Sepez41d04e12018-10-30 22:07:36 +000025 "cfx_globaldata.cpp",
26 "cfx_globaldata.h",
27 "cfx_keyvalue.cpp",
28 "cfx_keyvalue.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000029 "cfx_v8.cpp",
30 "cfx_v8.h",
Lei Zhang020fbf22021-09-21 21:58:22 +000031 "cfx_v8_array_buffer_allocator.cpp",
32 "cfx_v8_array_buffer_allocator.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000033 "cfxjs_engine.cpp",
34 "cfxjs_engine.h",
35 "cjs_annot.cpp",
36 "cjs_annot.h",
37 "cjs_app.cpp",
38 "cjs_app.h",
39 "cjs_border.cpp",
40 "cjs_border.h",
41 "cjs_color.cpp",
42 "cjs_color.h",
43 "cjs_console.cpp",
44 "cjs_console.h",
45 "cjs_delaydata.cpp",
46 "cjs_delaydata.h",
47 "cjs_display.cpp",
48 "cjs_display.h",
49 "cjs_document.cpp",
50 "cjs_document.h",
51 "cjs_event.cpp",
52 "cjs_event.h",
53 "cjs_event_context.cpp",
54 "cjs_event_context.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000055 "cjs_field.cpp",
56 "cjs_field.h",
57 "cjs_font.cpp",
58 "cjs_font.h",
59 "cjs_global.cpp",
60 "cjs_global.h",
61 "cjs_globalarrays.cpp",
62 "cjs_globalarrays.h",
63 "cjs_globalconsts.cpp",
64 "cjs_globalconsts.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000065 "cjs_highlight.cpp",
66 "cjs_highlight.h",
67 "cjs_icon.cpp",
68 "cjs_icon.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000069 "cjs_object.cpp",
70 "cjs_object.h",
71 "cjs_position.cpp",
72 "cjs_position.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000073 "cjs_publicmethods.cpp",
74 "cjs_publicmethods.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000075 "cjs_result.cpp",
76 "cjs_result.h",
77 "cjs_runtime.cpp",
78 "cjs_runtime.h",
79 "cjs_scalehow.cpp",
80 "cjs_scalehow.h",
81 "cjs_scalewhen.cpp",
82 "cjs_scalewhen.h",
83 "cjs_style.cpp",
84 "cjs_style.h",
85 "cjs_timerobj.cpp",
86 "cjs_timerobj.h",
87 "cjs_util.cpp",
88 "cjs_util.h",
89 "cjs_zoomtype.cpp",
90 "cjs_zoomtype.h",
Tom Sepez86e5fbf2018-11-01 21:21:52 +000091 "fx_date_helpers.cpp",
92 "fx_date_helpers.h",
Tom Sepez3466e272020-03-18 23:33:35 +000093 "fxv8.cpp",
94 "fxv8.h",
Lei Zhanga7dec322018-10-12 18:36:51 +000095 "global_timer.cpp",
96 "global_timer.h",
97 "js_define.cpp",
98 "js_define.h",
99 "js_resources.cpp",
100 "js_resources.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000101 ]
102 deps += [
Lei Zhang85549b42019-02-02 00:40:19 +0000103 "../constants",
Lei Zhangbc75f622018-10-15 18:12:40 +0000104 "../core/fdrm",
Lei Zhangbc75f622018-10-15 18:12:40 +0000105 "../core/fpdfapi/page",
106 "../core/fpdfapi/parser",
Tom Sepez0208b0c2019-07-23 21:52:50 +0000107 "../core/fpdfapi/render",
Lei Zhangbc75f622018-10-15 18:12:40 +0000108 "../core/fpdfdoc",
109 "../core/fxge",
Lei Zhanga7dec322018-10-12 18:36:51 +0000110 "//v8",
111 "//v8:v8_libplatform",
112 ]
113 configs += [ "//v8:external_startup_data" ]
Lei Zhang7b75fbf2021-09-28 20:35:15 +0000114 public_deps += [
115 "../core/fxcrt",
116 "//v8",
117 ]
Lei Zhanga7dec322018-10-12 18:36:51 +0000118
119 if (pdf_enable_xfa) {
120 sources += [
Tom Sepez70e52142018-12-13 20:07:50 +0000121 "xfa/cfxjse_class.cpp",
122 "xfa/cfxjse_class.h",
123 "xfa/cfxjse_context.cpp",
124 "xfa/cfxjse_context.h",
125 "xfa/cfxjse_engine.cpp",
126 "xfa/cfxjse_engine.h",
127 "xfa/cfxjse_formcalc_context.cpp",
128 "xfa/cfxjse_formcalc_context.h",
129 "xfa/cfxjse_isolatetracker.cpp",
130 "xfa/cfxjse_isolatetracker.h",
Tom Sepez53999b42020-10-09 16:16:41 +0000131 "xfa/cfxjse_mapmodule.cpp",
132 "xfa/cfxjse_mapmodule.h",
Tom Sepez37330a32020-08-05 18:35:06 +0000133 "xfa/cfxjse_nodehelper.cpp",
134 "xfa/cfxjse_nodehelper.h",
Tom Sepez70e52142018-12-13 20:07:50 +0000135 "xfa/cfxjse_resolveprocessor.cpp",
136 "xfa/cfxjse_resolveprocessor.h",
137 "xfa/cfxjse_runtimedata.cpp",
138 "xfa/cfxjse_runtimedata.h",
139 "xfa/cfxjse_value.cpp",
140 "xfa/cfxjse_value.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000141 "xfa/cjx_boolean.cpp",
142 "xfa/cjx_boolean.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000143 "xfa/cjx_container.cpp",
144 "xfa/cjx_container.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000145 "xfa/cjx_datawindow.cpp",
146 "xfa/cjx_datawindow.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000147 "xfa/cjx_delta.cpp",
148 "xfa/cjx_delta.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000149 "xfa/cjx_desc.cpp",
150 "xfa/cjx_desc.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000151 "xfa/cjx_draw.cpp",
152 "xfa/cjx_draw.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000153 "xfa/cjx_encrypt.cpp",
154 "xfa/cjx_encrypt.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000155 "xfa/cjx_eventpseudomodel.cpp",
156 "xfa/cjx_eventpseudomodel.h",
157 "xfa/cjx_exclgroup.cpp",
158 "xfa/cjx_exclgroup.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000159 "xfa/cjx_extras.cpp",
160 "xfa/cjx_extras.h",
161 "xfa/cjx_field.cpp",
162 "xfa/cjx_field.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000163 "xfa/cjx_form.cpp",
164 "xfa/cjx_form.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000165 "xfa/cjx_handler.cpp",
166 "xfa/cjx_handler.h",
167 "xfa/cjx_hostpseudomodel.cpp",
168 "xfa/cjx_hostpseudomodel.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000169 "xfa/cjx_instancemanager.cpp",
170 "xfa/cjx_instancemanager.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000171 "xfa/cjx_layoutpseudomodel.cpp",
172 "xfa/cjx_layoutpseudomodel.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000173 "xfa/cjx_list.cpp",
174 "xfa/cjx_list.h",
175 "xfa/cjx_logpseudomodel.cpp",
176 "xfa/cjx_logpseudomodel.h",
177 "xfa/cjx_manifest.cpp",
178 "xfa/cjx_manifest.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000179 "xfa/cjx_model.cpp",
180 "xfa/cjx_model.h",
181 "xfa/cjx_node.cpp",
182 "xfa/cjx_node.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000183 "xfa/cjx_object.cpp",
184 "xfa/cjx_object.h",
185 "xfa/cjx_occur.cpp",
186 "xfa/cjx_occur.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000187 "xfa/cjx_packet.cpp",
188 "xfa/cjx_packet.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000189 "xfa/cjx_script.cpp",
190 "xfa/cjx_script.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000191 "xfa/cjx_signaturepseudomodel.cpp",
192 "xfa/cjx_signaturepseudomodel.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000193 "xfa/cjx_source.cpp",
194 "xfa/cjx_source.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000195 "xfa/cjx_subform.cpp",
196 "xfa/cjx_subform.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000197 "xfa/cjx_template.cpp",
198 "xfa/cjx_template.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000199 "xfa/cjx_textnode.cpp",
200 "xfa/cjx_textnode.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000201 "xfa/cjx_tree.cpp",
202 "xfa/cjx_tree.h",
203 "xfa/cjx_treelist.cpp",
204 "xfa/cjx_treelist.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000205 "xfa/cjx_wsdlconnection.cpp",
206 "xfa/cjx_wsdlconnection.h",
207 "xfa/cjx_xfa.cpp",
208 "xfa/cjx_xfa.h",
Tom Sepez70e52142018-12-13 20:07:50 +0000209 "xfa/fxjse.cpp",
210 "xfa/fxjse.h",
Tom Sepez49dbb7f2018-12-19 17:56:55 +0000211 "xfa/jse_define.h",
Lei Zhanga7dec322018-10-12 18:36:51 +0000212 ]
Tom Sepez92cc7932019-01-15 17:39:45 +0000213 deps += [
Tom Sepeza7f5b492020-09-09 21:39:17 +0000214 ":gc",
Tom Sepeza58a6762020-10-14 00:14:53 +0000215 "../xfa/fgas/crt",
Lei Zhang605b4e12022-02-24 01:43:24 +0000216 "../xfa/fxfa/formcalc",
Tom Sepez92cc7932019-01-15 17:39:45 +0000217 ]
Lei Zhanga7dec322018-10-12 18:36:51 +0000218 }
219 }
220}
Lei Zhangf03f7812018-10-15 23:48:29 +0000221
222if (pdf_enable_v8) {
Tom Sepeza7f5b492020-09-09 21:39:17 +0000223 if (pdf_enable_xfa) {
224 source_set("gc") {
225 sources = [
226 "gc/container_trace.h",
227 "gc/gced_tree_node.h",
228 "gc/gced_tree_node_mixin.h",
229 "gc/heap.cpp",
230 "gc/heap.h",
231 ]
Lei Zhang7a5f8ee2021-04-24 00:19:10 +0000232 configs += [ "../:pdfium_strict_config" ]
Tom Sepeza7f5b492020-09-09 21:39:17 +0000233 deps = [
234 "../core/fxcrt",
235 "//v8:v8_libplatform",
236 ]
237 public_deps = [ "//v8:cppgc" ]
238 }
239 }
240}
241
242if (pdf_enable_v8) {
Lei Zhangf03f7812018-10-15 23:48:29 +0000243 pdfium_unittest_source_set("unittests") {
244 sources = [
Tom Sepezeccfe0e2018-11-01 16:34:52 +0000245 "cfx_globaldata_unittest.cpp",
Lei Zhangf03f7812018-10-15 23:48:29 +0000246 "cfx_v8_unittest.cpp",
Lei Zhangf03f7812018-10-15 23:48:29 +0000247 "cfxjs_engine_unittest.cpp",
248 "cjs_publicmethods_unittest.cpp",
249 "cjs_util_unittest.cpp",
Lei Zhang9fa72472019-10-10 16:35:16 +0000250 "fx_date_helpers_unittest.cpp",
Lei Zhangf03f7812018-10-15 23:48:29 +0000251 ]
252 configs = [ "//v8:external_startup_data" ]
Lei Zhang40f9d722020-01-24 00:18:11 +0000253 deps = [ ":fxjs" ]
Lei Zhangf03f7812018-10-15 23:48:29 +0000254 pdfium_root_dir = "../"
Tom Sepezeaf9d212020-07-22 16:24:00 +0000255 if (pdf_enable_xfa) {
256 sources += [
Tom Sepez497f62e2020-09-01 21:38:42 +0000257 "gc/container_trace_unittest.cpp",
Tom Sepez775353b2020-07-31 23:05:25 +0000258 "gc/gced_tree_node_mixin_unittest.cpp",
Tom Sepezeaf9d212020-07-22 16:24:00 +0000259 "gc/gced_tree_node_unittest.cpp",
260 "gc/heap_unittest.cpp",
Tom Sepez9cfa23c2020-08-27 00:10:37 +0000261 "gc/move_unittest.cpp",
Lei Zhang3285fc22022-02-28 21:57:29 +0000262 "xfa/cfxjse_formcalc_context_unittest.cpp",
Tom Sepez53999b42020-10-09 16:16:41 +0000263 "xfa/cfxjse_mapmodule_unittest.cpp",
Tom Sepezeaf9d212020-07-22 16:24:00 +0000264 ]
Tom Sepez53999b42020-10-09 16:16:41 +0000265 deps += [
266 ":gc",
267 "../xfa/fxfa/parser",
268 ]
Tom Sepezeaf9d212020-07-22 16:24:00 +0000269 }
Lei Zhangf03f7812018-10-15 23:48:29 +0000270 }
Lei Zhang1929d6e2018-10-15 23:51:28 +0000271
272 pdfium_embeddertest_source_set("embeddertests") {
273 sources = [
274 "cfxjs_engine_embeddertest.cpp",
275 "cjs_publicmethods_embeddertest.cpp",
276 ]
277 configs = [ "//v8:external_startup_data" ]
278 deps = [
279 ":fxjs",
Lei Zhangb5365882019-06-12 01:38:17 +0000280 "../fpdfsdk",
Lei Zhang1929d6e2018-10-15 23:51:28 +0000281 ]
282 pdfium_root_dir = "../"
Lei Zhang1929d6e2018-10-15 23:51:28 +0000283 if (pdf_enable_xfa) {
Tom Sepez47617702019-01-23 21:55:41 +0000284 sources += [
Lei Zhang15c0b1e2019-03-05 19:54:16 +0000285 "xfa/cfxjse_app_embeddertest.cpp",
Tom Sepez47617702019-01-23 21:55:41 +0000286 "xfa/cfxjse_formcalc_context_embeddertest.cpp",
287 "xfa/cfxjse_value_embeddertest.cpp",
Lei Zhangef35a822019-03-12 21:38:19 +0000288 "xfa/cjx_hostpseudomodel_embeddertest.cpp",
Lei Zhang601809e2019-03-22 17:54:39 +0000289 "xfa/cjx_list_embeddertest.cpp",
Tom Sepez47617702019-01-23 21:55:41 +0000290 ]
Tom Sepezf954d132020-06-12 22:10:03 +0000291 deps += [
Tom Sepeza7f5b492020-09-09 21:39:17 +0000292 ":gc",
Tom Sepezf954d132020-06-12 22:10:03 +0000293 "../xfa/fxfa",
Tom Sepezf954d132020-06-12 22:10:03 +0000294 ]
Lei Zhang1929d6e2018-10-15 23:51:28 +0000295 }
296 }
Lei Zhangf03f7812018-10-15 23:48:29 +0000297}