Remove two more unused variables that compilers now complain about.
[pdfium.git] / BUILD.gn
1 # Copyright 2014 The Chromium 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
5 import("//testing/test.gni")
6 import("pdfium.gni")
7
8 config("pdfium_config") {
9   cflags = []
10   include_dirs = [ "third_party/freetype/include" ]
11   defines = [
12     "OPJ_STATIC",
13     "V8_DEPRECATION_WARNINGS",
14     "_CRT_SECURE_NO_WARNINGS",
15   ]
16
17   if (pdf_use_skia) {
18     defines += [ "_SKIA_SUPPORT_" ]
19   }
20
21   if (pdf_enable_v8) {
22     defines += [ "PDF_ENABLE_V8" ]
23   }
24
25   if (is_linux) {
26     if (current_cpu == "x64") {
27       defines += [ "_FX_CPU_=_FX_X64_" ]
28       cflags += [ "-fPIC" ]
29     } else if (current_cpu == "x86") {
30       defines += [ "_FX_CPU_=_FX_X86_" ]
31     }
32   }
33
34   if (is_win) {
35     cflags += [
36       "/wd4005",
37       "/wd4018",
38       "/wd4146",
39       "/wd4333",
40       "/wd4345",
41       # TODO(thestig): Fix all instances, remove this, pdfium:29
42       "/wd4245",
43       "/wd4310",
44       "/wd4389",
45       "/wd4701",
46       "/wd4702",
47       "/wd4706",
48       "/wd4800",
49     ]
50   }
51
52   if (is_clang) {
53     # TODO(thestig): Fix all instances, remove this, pdfium:29
54     cflags += [ "-Wno-sign-compare" ]
55   }
56 }
57
58 static_library("pdfium") {
59   sources = [
60     "fpdfsdk/include/fsdk_actionhandler.h",
61     "fpdfsdk/include/fsdk_annothandler.h",
62     "fpdfsdk/include/fsdk_baseannot.h",
63     "fpdfsdk/include/fsdk_baseform.h",
64     "fpdfsdk/src/fpdf_dataavail.cpp",
65     "fpdfsdk/src/fpdf_ext.cpp",
66     "fpdfsdk/src/fpdf_flatten.cpp",
67     "fpdfsdk/src/fpdf_progressive.cpp",
68     "fpdfsdk/src/fpdf_searchex.cpp",
69     "fpdfsdk/src/fpdf_sysfontinfo.cpp",
70     "fpdfsdk/src/fpdf_transformpage.cpp",
71     "fpdfsdk/src/fpdfdoc.cpp",
72     "fpdfsdk/src/fpdfeditimg.cpp",
73     "fpdfsdk/src/fpdfeditpage.cpp",
74     "fpdfsdk/src/fpdfformfill.cpp",
75     "fpdfsdk/src/fpdfppo.cpp",
76     "fpdfsdk/src/fpdfsave.cpp",
77     "fpdfsdk/src/fpdftext.cpp",
78     "fpdfsdk/src/fpdfview.cpp",
79     "fpdfsdk/src/fsdk_actionhandler.cpp",
80     "fpdfsdk/src/fsdk_annothandler.cpp",
81     "fpdfsdk/src/fsdk_baseannot.cpp",
82     "fpdfsdk/src/fsdk_baseform.cpp",
83     "fpdfsdk/src/fsdk_mgr.cpp",
84     "fpdfsdk/src/fsdk_rendercontext.cpp",
85     "public/fpdf_dataavail.h",
86     "public/fpdf_doc.h",
87     "public/fpdf_edit.h",
88     "public/fpdf_ext.h",
89     "public/fpdf_flatten.h",
90     "public/fpdf_formfill.h",
91     "public/fpdf_fwlevent.h",
92     "public/fpdf_ppo.h",
93     "public/fpdf_progressive.h",
94     "public/fpdf_save.h",
95     "public/fpdf_searchex.h",
96     "public/fpdf_sysfontinfo.h",
97     "public/fpdf_text.h",
98     "public/fpdf_transformpage.h",
99     "public/fpdfview.h",
100   ]
101
102   libs = []
103   configs += [ ":pdfium_config" ]
104
105   deps = [
106     "third_party:bigint",
107     "third_party:pdfium_base",
108     ":fdrm",
109     ":formfiller",
110     ":fpdfapi",
111     ":fpdfdoc",
112     ":fpdftext",
113     ":fxcodec",
114     ":fxcrt",
115     ":fxedit",
116     ":fxge",
117     ":javascript",
118     ":pdfwindow",
119   ]
120
121   if (is_win) {
122     libs += [
123       "advapi32.lib",
124       "gdi32.lib",
125       "user32.lib",
126     ]
127   }
128
129   if (is_mac) {
130     libs += [
131       "AppKit.framework",
132       "CoreFoundation.framework",
133     ]
134   }
135
136   if (pdfium_bundle_freetype) {
137     deps += [ "third_party:fx_freetype" ]
138   } else {
139     libs += [ "freetype" ]
140   }
141 }
142
143 source_set("test_support") {
144   testonly = true
145   sources = [
146     "testing/fx_string_testhelpers.cpp",
147     "testing/fx_string_testhelpers.h",
148     "testing/test_support.cpp",
149     "testing/test_support.h",
150   ]
151   deps = [
152     "//testing/gmock",
153     "//testing/gtest",
154     ":pdfium",
155   ]
156   include_dirs = [
157     "."
158   ]
159   if (pdf_enable_v8) {
160     deps += [
161       "//v8",
162       "//v8:v8_libplatform",
163     ]
164     include_dirs += [
165       "//v8",
166       "//v8/include",
167     ]
168   }
169   configs += [ ":pdfium_config" ]
170 }
171
172 # Targets below this are only visible within this file (and to the
173 # top-level gn_visibility target used to help gn_all build everything).
174 visibility = [
175   ":*",
176   "//:gn_visibility",
177 ]
178
179 static_library("fdrm") {
180   sources = [
181     "core/include/fdrm/fx_crypt.h",
182     "core/src/fdrm/crypto/fx_crypt.cpp",
183     "core/src/fdrm/crypto/fx_crypt_aes.cpp",
184     "core/src/fdrm/crypto/fx_crypt_sha.cpp",
185   ]
186   configs += [ ":pdfium_config" ]
187 }
188
189 static_library("fpdfdoc") {
190   sources = [
191     "core/include/fpdfdoc/fpdf_ap.h",
192     "core/include/fpdfdoc/fpdf_doc.h",
193     "core/include/fpdfdoc/fpdf_tagged.h",
194     "core/include/fpdfdoc/fpdf_vt.h",
195     "core/src/fpdfdoc/doc_action.cpp",
196     "core/src/fpdfdoc/doc_annot.cpp",
197     "core/src/fpdfdoc/doc_ap.cpp",
198     "core/src/fpdfdoc/doc_basic.cpp",
199     "core/src/fpdfdoc/doc_bookmark.cpp",
200     "core/src/fpdfdoc/doc_form.cpp",
201     "core/src/fpdfdoc/doc_formcontrol.cpp",
202     "core/src/fpdfdoc/doc_formfield.cpp",
203     "core/src/fpdfdoc/doc_link.cpp",
204     "core/src/fpdfdoc/doc_metadata.cpp",
205     "core/src/fpdfdoc/doc_ocg.cpp",
206     "core/src/fpdfdoc/doc_tagged.cpp",
207     "core/src/fpdfdoc/doc_utils.cpp",
208     "core/src/fpdfdoc/doc_utils.h",
209     "core/src/fpdfdoc/doc_viewerPreferences.cpp",
210     "core/src/fpdfdoc/doc_vt.cpp",
211     "core/src/fpdfdoc/doc_vtmodule.cpp",
212     "core/src/fpdfdoc/pdf_vt.h",
213     "core/src/fpdfdoc/tagged_int.h",
214   ]
215   configs += [ ":pdfium_config" ]
216 }
217
218 static_library("fpdfapi") {
219   sources = [
220     "core/include/fpdfapi/fpdf_module.h",
221     "core/include/fpdfapi/fpdf_objects.h",
222     "core/include/fpdfapi/fpdf_page.h",
223     "core/include/fpdfapi/fpdf_pageobj.h",
224     "core/include/fpdfapi/fpdf_parser.h",
225     "core/include/fpdfapi/fpdf_render.h",
226     "core/include/fpdfapi/fpdf_resource.h",
227     "core/include/fpdfapi/fpdf_serial.h",
228     "core/include/fpdfapi/fpdfapi.h",
229     "core/src/fpdfapi/fpdf_basic_module.cpp",
230     "core/src/fpdfapi/fpdf_cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp",
231     "core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp",
232     "core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp",
233     "core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp",
234     "core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp",
235     "core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp",
236     "core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp",
237     "core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp",
238     "core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp",
239     "core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-H_5.cpp",
240     "core/src/fpdfapi/fpdf_cmaps/CNS1/HKscs-B5-V_5.cpp",
241     "core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-H_3.cpp",
242     "core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UCS2-V_3.cpp",
243     "core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp",
244     "core/src/fpdfapi/fpdf_cmaps/CNS1/cmaps_cns1.cpp",
245     "core/src/fpdfapi/fpdf_cmaps/GB1/Adobe-GB1-UCS2_5.cpp",
246     "core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp",
247     "core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp",
248     "core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp",
249     "core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-V_2.cpp",
250     "core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-H_5.cpp",
251     "core/src/fpdfapi/fpdf_cmaps/GB1/GBK2K-V_5.cpp",
252     "core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp",
253     "core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-V_2.cpp",
254     "core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp",
255     "core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp",
256     "core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp",
257     "core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-V_4.cpp",
258     "core/src/fpdfapi/fpdf_cmaps/GB1/cmaps_gb1.cpp",
259     "core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp",
260     "core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp",
261     "core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-V_2.cpp",
262     "core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp",
263     "core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-V_2.cpp",
264     "core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp",
265     "core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp",
266     "core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp",
267     "core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp",
268     "core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp",
269     "core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-V_1.cpp",
270     "core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-H_2.cpp",
271     "core/src/fpdfapi/fpdf_cmaps/Japan1/Ext-RKSJ-V_2.cpp",
272     "core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp",
273     "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp",
274     "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp",
275     "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp",
276     "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp",
277     "core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp",
278     "core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp",
279     "core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp",
280     "core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp",
281     "core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp",
282     "core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp",
283     "core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-V_1.cpp",
284     "core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp",
285     "core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-V_1.cpp",
286     "core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp",
287     "core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp",
288     "core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-V_1.cpp",
289     "core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp",
290     "core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp",
291     "core/src/fpdfapi/fpdf_cmaps/cmap_int.h",
292     "core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp",
293     "core/src/fpdfapi/fpdf_edit/editint.h",
294     "core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp",
295     "core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp",
296     "core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp",
297     "core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp",
298     "core/src/fpdfapi/fpdf_font/common.h",
299     "core/src/fpdfapi/fpdf_font/font_int.h",
300     "core/src/fpdfapi/fpdf_font/fpdf_font.cpp",
301     "core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp",
302     "core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp",
303     "core/src/fpdfapi/fpdf_font/ttgsubtable.cpp",
304     "core/src/fpdfapi/fpdf_font/ttgsubtable.h",
305     "core/src/fpdfapi/fpdf_page/fpdf_page.cpp",
306     "core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp",
307     "core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp",
308     "core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp",
309     "core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp",
310     "core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp",
311     "core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp",
312     "core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp",
313     "core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp",
314     "core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp",
315     "core/src/fpdfapi/fpdf_page/pageint.h",
316     "core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp",
317     "core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp",
318     "core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp",
319     "core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp",
320     "core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp",
321     "core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp",
322     "core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp",
323     "core/src/fpdfapi/fpdf_render/fpdf_render.cpp",
324     "core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp",
325     "core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp",
326     "core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp",
327     "core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp",
328     "core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp",
329     "core/src/fpdfapi/fpdf_render/render_int.h",
330   ]
331   configs += [ ":pdfium_config" ]
332 }
333
334 static_library("fpdftext") {
335   sources = [
336     "core/include/fpdftext/fpdf_text.h",
337     "core/src/fpdftext/fpdf_text.cpp",
338     "core/src/fpdftext/fpdf_text_int.cpp",
339     "core/src/fpdftext/fpdf_text_search.cpp",
340     "core/src/fpdftext/text_int.h",
341     "core/src/fpdftext/txtproc.h",
342     "core/src/fpdftext/unicodenormalization.cpp",
343     "core/src/fpdftext/unicodenormalizationdata.cpp",
344     "core/src/fpdftext/unicodenormalizationdata.h",
345   ]
346   configs += [ ":pdfium_config" ]
347 }
348
349 static_library("fxcodec") {
350   deps = [
351     "third_party:fx_lcms2",
352     "third_party:fx_libjpeg",
353     "third_party:fx_libopenjpeg",
354     "third_party:fx_zlib",
355   ]
356   sources = [
357     "core/include/fxcodec/fx_codec.h",
358     "core/include/fxcodec/fx_codec_def.h",
359     "core/include/fxcodec/fx_codec_flate.h",
360     "core/src/fxcodec/codec/codec_int.h",
361     "core/src/fxcodec/codec/fx_codec.cpp",
362     "core/src/fxcodec/codec/fx_codec_fax.cpp",
363     "core/src/fxcodec/codec/fx_codec_flate.cpp",
364     "core/src/fxcodec/codec/fx_codec_icc.cpp",
365     "core/src/fxcodec/codec/fx_codec_jbig.cpp",
366     "core/src/fxcodec/codec/fx_codec_jbig_enc.cpp",
367     "core/src/fxcodec/codec/fx_codec_jpeg.cpp",
368     "core/src/fxcodec/codec/fx_codec_jpx_opj.cpp",
369     "core/src/fxcodec/jbig2/JBig2_ArithDecoder.cpp",
370     "core/src/fxcodec/jbig2/JBig2_ArithDecoder.h",
371     "core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp",
372     "core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h",
373     "core/src/fxcodec/jbig2/JBig2_BitStream.cpp",
374     "core/src/fxcodec/jbig2/JBig2_BitStream.h",
375     "core/src/fxcodec/jbig2/JBig2_Context.cpp",
376     "core/src/fxcodec/jbig2/JBig2_Context.h",
377     "core/src/fxcodec/jbig2/JBig2_Define.h",
378     "core/src/fxcodec/jbig2/JBig2_GrdProc.cpp",
379     "core/src/fxcodec/jbig2/JBig2_GrdProc.h",
380     "core/src/fxcodec/jbig2/JBig2_GrrdProc.cpp",
381     "core/src/fxcodec/jbig2/JBig2_GrrdProc.h",
382     "core/src/fxcodec/jbig2/JBig2_GsidProc.cpp",
383     "core/src/fxcodec/jbig2/JBig2_GsidProc.h",
384     "core/src/fxcodec/jbig2/JBig2_HtrdProc.cpp",
385     "core/src/fxcodec/jbig2/JBig2_HtrdProc.h",
386     "core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp",
387     "core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h",
388     "core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp",
389     "core/src/fxcodec/jbig2/JBig2_HuffmanTable.h",
390     "core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h",
391     "core/src/fxcodec/jbig2/JBig2_Image.cpp",
392     "core/src/fxcodec/jbig2/JBig2_Image.h",
393     "core/src/fxcodec/jbig2/JBig2_List.h",
394     "core/src/fxcodec/jbig2/JBig2_Page.h",
395     "core/src/fxcodec/jbig2/JBig2_PatternDict.cpp",
396     "core/src/fxcodec/jbig2/JBig2_PatternDict.h",
397     "core/src/fxcodec/jbig2/JBig2_PddProc.cpp",
398     "core/src/fxcodec/jbig2/JBig2_PddProc.h",
399     "core/src/fxcodec/jbig2/JBig2_SddProc.cpp",
400     "core/src/fxcodec/jbig2/JBig2_SddProc.h",
401     "core/src/fxcodec/jbig2/JBig2_Segment.cpp",
402     "core/src/fxcodec/jbig2/JBig2_Segment.h",
403     "core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp",
404     "core/src/fxcodec/jbig2/JBig2_SymbolDict.h",
405     "core/src/fxcodec/jbig2/JBig2_TrdProc.cpp",
406     "core/src/fxcodec/jbig2/JBig2_TrdProc.h",
407   ]
408
409   if (is_posix) {
410     # core/src/fxcodec/fx_libopenjpeg/src/fx_mct.c does an pointer-to-int
411     # conversion to check that an address is 16-bit aligned (benign).
412     cflags_c = [ "-Wno-pointer-to-int-cast" ]
413   }
414   configs += [ ":pdfium_config" ]
415 }
416
417 config("fxge_warnings") {
418   if (is_clang) {
419     cflags = [
420       # http://code.google.com/p/pdfium/issues/detail?id=188
421       "-Wno-switch",
422     ]
423   }
424 }
425
426 static_library("fxcrt") {
427   sources = [
428     "core/include/fxcrt/fx_basic.h",
429     "core/include/fxcrt/fx_bidi.h",
430     "core/include/fxcrt/fx_coordinates.h",
431     "core/include/fxcrt/fx_ext.h",
432     "core/include/fxcrt/fx_memory.h",
433     "core/include/fxcrt/fx_safe_types.h",
434     "core/include/fxcrt/fx_stream.h",
435     "core/include/fxcrt/fx_string.h",
436     "core/include/fxcrt/fx_system.h",
437     "core/include/fxcrt/fx_ucd.h",
438     "core/include/fxcrt/fx_xml.h",
439     "core/src/fxcrt/extension.h",
440     "core/src/fxcrt/fx_basic_array.cpp",
441     "core/src/fxcrt/fx_basic_bstring.cpp",
442     "core/src/fxcrt/fx_basic_buffer.cpp",
443     "core/src/fxcrt/fx_basic_coords.cpp",
444     "core/src/fxcrt/fx_basic_gcc.cpp",
445     "core/src/fxcrt/fx_basic_list.cpp",
446     "core/src/fxcrt/fx_basic_maps.cpp",
447     "core/src/fxcrt/fx_basic_memmgr.cpp",
448     "core/src/fxcrt/fx_basic_plex.cpp",
449     "core/src/fxcrt/fx_basic_utf.cpp",
450     "core/src/fxcrt/fx_basic_util.cpp",
451     "core/src/fxcrt/fx_basic_wstring.cpp",
452     "core/src/fxcrt/fx_bidi.cpp",
453     "core/src/fxcrt/fx_extension.cpp",
454     "core/src/fxcrt/fx_ucddata.cpp",
455     "core/src/fxcrt/fx_unicode.cpp",
456     "core/src/fxcrt/fx_xml_composer.cpp",
457     "core/src/fxcrt/fx_xml_parser.cpp",
458     "core/src/fxcrt/fxcrt_platforms.cpp",
459     "core/src/fxcrt/fxcrt_platforms.h",
460     "core/src/fxcrt/fxcrt_posix.cpp",
461     "core/src/fxcrt/fxcrt_posix.h",
462     "core/src/fxcrt/fxcrt_windows.cpp",
463     "core/src/fxcrt/fxcrt_windows.h",
464     "core/src/fxcrt/plex.h",
465     "core/src/fxcrt/xml_int.h",
466   ]
467   configs += [ ":pdfium_config" ]
468 }
469
470 static_library("fxge") {
471   deps = [
472     "third_party:fx_agg",
473   ]
474   sources = [
475     "core/include/fxge/fpf.h",
476     "core/include/fxge/fx_dib.h",
477     "core/include/fxge/fx_font.h",
478     "core/include/fxge/fx_freetype.h",
479     "core/include/fxge/fx_ge.h",
480     "core/include/fxge/fx_ge_apple.h",
481     "core/include/fxge/fx_ge_win32.h",
482     "core/src/fxge/agg/include/fx_agg_driver.h",
483     "core/src/fxge/agg/src/fx_agg_driver.cpp",
484     "core/src/fxge/android/fpf_skiafont.cpp",
485     "core/src/fxge/android/fpf_skiafont.h",
486     "core/src/fxge/android/fpf_skiafontmgr.cpp",
487     "core/src/fxge/android/fpf_skiafontmgr.h",
488     "core/src/fxge/android/fpf_skiamodule.cpp",
489     "core/src/fxge/android/fpf_skiamodule.h",
490     "core/src/fxge/android/fx_android_font.cpp",
491     "core/src/fxge/android/fx_android_font.h",
492     "core/src/fxge/android/fx_android_imp.cpp",
493     "core/src/fxge/android/fx_fpf.h",
494     "core/src/fxge/apple/apple_int.h",
495     "core/src/fxge/apple/fx_apple_platform.cpp",
496     "core/src/fxge/apple/fx_mac_imp.cpp",
497     "core/src/fxge/apple/fx_quartz_device.cpp",
498     "core/src/fxge/dib/dib_int.h",
499     "core/src/fxge/dib/fx_dib_composite.cpp",
500     "core/src/fxge/dib/fx_dib_convert.cpp",
501     "core/src/fxge/dib/fx_dib_engine.cpp",
502     "core/src/fxge/dib/fx_dib_main.cpp",
503     "core/src/fxge/dib/fx_dib_transform.cpp",
504     "core/src/fxge/fontdata/chromefontdata/chromefontdata.h",
505     "core/src/fxge/fontdata/chromefontdata/FoxitDingbats.c",
506     "core/src/fxge/fontdata/chromefontdata/FoxitFixed.c",
507     "core/src/fxge/fontdata/chromefontdata/FoxitFixedBold.c",
508     "core/src/fxge/fontdata/chromefontdata/FoxitFixedBoldItalic.c",
509     "core/src/fxge/fontdata/chromefontdata/FoxitFixedItalic.c",
510     "core/src/fxge/fontdata/chromefontdata/FoxitSans.c",
511     "core/src/fxge/fontdata/chromefontdata/FoxitSansBold.c",
512     "core/src/fxge/fontdata/chromefontdata/FoxitSansBoldItalic.c",
513     "core/src/fxge/fontdata/chromefontdata/FoxitSansItalic.c",
514     "core/src/fxge/fontdata/chromefontdata/FoxitSansMM.c",
515     "core/src/fxge/fontdata/chromefontdata/FoxitSerif.c",
516     "core/src/fxge/fontdata/chromefontdata/FoxitSerifBold.c",
517     "core/src/fxge/fontdata/chromefontdata/FoxitSerifBoldItalic.c",
518     "core/src/fxge/fontdata/chromefontdata/FoxitSerifItalic.c",
519     "core/src/fxge/fontdata/chromefontdata/FoxitSerifMM.c",
520     "core/src/fxge/fontdata/chromefontdata/FoxitSymbol.c",
521     "core/src/fxge/freetype/fx_freetype.c",
522     "core/src/fxge/ge/fx_ge.cpp",
523     "core/src/fxge/ge/fx_ge_device.cpp",
524     "core/src/fxge/ge/fx_ge_font.cpp",
525     "core/src/fxge/ge/fx_ge_fontmap.cpp",
526     "core/src/fxge/ge/fx_ge_linux.cpp",
527     "core/src/fxge/ge/fx_ge_path.cpp",
528     "core/src/fxge/ge/fx_ge_ps.cpp",
529     "core/src/fxge/ge/fx_ge_text.cpp",
530     "core/src/fxge/ge/text_int.h",
531   ]
532
533   configs += [
534     ":fxge_warnings",
535     ":pdfium_config",
536   ]
537
538   if (pdf_use_skia) {
539     sources = [
540       "core/src/fxge/skia/fx_skia_blitter_new.cpp",
541       "core/src/fxge/skia/fx_skia_device.cpp",
542     ]
543     include_dirs = [
544       "//third_party/skia/include/config",
545       "//third_party/skia/include/core",
546       "//third_party/skia/include/effects",
547       "//third_party/skia/include/images",
548       "//third_party/skia/include/lazy",
549       "//third_party/skia/include/pathops",
550       "//third_party/skia/include/utils",
551       "//third_party/skia/src/core",
552     ]
553     deps = [ "//skia" ]
554   }
555
556   if (is_win) {
557     sources += [
558       "core/src/fxge/win32/dwrite_int.h",
559       "core/src/fxge/win32/fx_win32_device.cpp",
560       "core/src/fxge/win32/fx_win32_dib.cpp",
561       "core/src/fxge/win32/fx_win32_dwrite.cpp",
562       "core/src/fxge/win32/fx_win32_gdipext.cpp",
563       "core/src/fxge/win32/fx_win32_print.cpp",
564       "core/src/fxge/win32/win32_int.h",
565     ]
566     configs -= [ "//build/config/win:lean_and_mean" ]
567   }
568 }
569
570 static_library("fxedit") {
571   sources = [
572     "fpdfsdk/include/fxedit/fx_edit.h",
573     "fpdfsdk/include/fxedit/fxet_edit.h",
574     "fpdfsdk/include/fxedit/fxet_list.h",
575     "fpdfsdk/include/fxedit/fxet_stub.h",
576     "fpdfsdk/src/fxedit/fxet_ap.cpp",
577     "fpdfsdk/src/fxedit/fxet_edit.cpp",
578     "fpdfsdk/src/fxedit/fxet_list.cpp",
579     "fpdfsdk/src/fxedit/fxet_module.cpp",
580     "fpdfsdk/src/fxedit/fxet_pageobjs.cpp",
581   ]
582   configs += [ ":pdfium_config" ]
583 }
584
585 static_library("pdfwindow") {
586   sources = [
587     "fpdfsdk/include/pdfwindow/IPDFWindow.h",
588     "fpdfsdk/include/pdfwindow/PDFWindow.h",
589     "fpdfsdk/include/pdfwindow/PWL_Button.h",
590     "fpdfsdk/include/pdfwindow/PWL_Caret.h",
591     "fpdfsdk/include/pdfwindow/PWL_ComboBox.h",
592     "fpdfsdk/include/pdfwindow/PWL_Edit.h",
593     "fpdfsdk/include/pdfwindow/PWL_EditCtrl.h",
594     "fpdfsdk/include/pdfwindow/PWL_FontMap.h",
595     "fpdfsdk/include/pdfwindow/PWL_Icon.h",
596     "fpdfsdk/include/pdfwindow/PWL_IconList.h",
597     "fpdfsdk/include/pdfwindow/PWL_Label.h",
598     "fpdfsdk/include/pdfwindow/PWL_ListBox.h",
599     "fpdfsdk/include/pdfwindow/PWL_ListCtrl.h",
600     "fpdfsdk/include/pdfwindow/PWL_Note.h",
601     "fpdfsdk/include/pdfwindow/PWL_ScrollBar.h",
602     "fpdfsdk/include/pdfwindow/PWL_Signature.h",
603     "fpdfsdk/include/pdfwindow/PWL_SpecialButton.h",
604     "fpdfsdk/include/pdfwindow/PWL_Utils.h",
605     "fpdfsdk/include/pdfwindow/PWL_Wnd.h",
606     "fpdfsdk/src/pdfwindow/PWL_Button.cpp",
607     "fpdfsdk/src/pdfwindow/PWL_Caret.cpp",
608     "fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp",
609     "fpdfsdk/src/pdfwindow/PWL_Edit.cpp",
610     "fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp",
611     "fpdfsdk/src/pdfwindow/PWL_FontMap.cpp",
612     "fpdfsdk/src/pdfwindow/PWL_Icon.cpp",
613     "fpdfsdk/src/pdfwindow/PWL_IconList.cpp",
614     "fpdfsdk/src/pdfwindow/PWL_Label.cpp",
615     "fpdfsdk/src/pdfwindow/PWL_ListBox.cpp",
616     "fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp",
617     "fpdfsdk/src/pdfwindow/PWL_Note.cpp",
618     "fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp",
619     "fpdfsdk/src/pdfwindow/PWL_Signature.cpp",
620     "fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp",
621     "fpdfsdk/src/pdfwindow/PWL_Utils.cpp",
622     "fpdfsdk/src/pdfwindow/PWL_Wnd.cpp",
623   ]
624   configs += [ ":pdfium_config" ]
625 }
626
627 static_library("javascript") {
628   sources = [
629     "fpdfsdk/include/javascript/IJavaScript.h",
630   ]
631   if (pdf_enable_v8) {
632     sources += [
633       "fpdfsdk/src/javascript/Consts.cpp",
634       "fpdfsdk/src/javascript/Consts.h",
635       "fpdfsdk/src/javascript/Document.cpp",
636       "fpdfsdk/src/javascript/Document.h",
637       "fpdfsdk/src/javascript/Field.cpp",
638       "fpdfsdk/src/javascript/Field.h",
639       "fpdfsdk/src/javascript/Icon.cpp",
640       "fpdfsdk/src/javascript/Icon.h",
641       "fpdfsdk/src/javascript/JS_Context.cpp",
642       "fpdfsdk/src/javascript/JS_Context.h",
643       "fpdfsdk/src/javascript/JS_Define.h",
644       "fpdfsdk/src/javascript/JS_EventHandler.cpp",
645       "fpdfsdk/src/javascript/JS_EventHandler.h",
646       "fpdfsdk/src/javascript/JS_GlobalData.cpp",
647       "fpdfsdk/src/javascript/JS_GlobalData.h",
648       "fpdfsdk/src/javascript/JS_Object.cpp",
649       "fpdfsdk/src/javascript/JS_Object.h",
650       "fpdfsdk/src/javascript/JS_Runtime.cpp",
651       "fpdfsdk/src/javascript/JS_Runtime.h",
652       "fpdfsdk/src/javascript/JS_Value.cpp",
653       "fpdfsdk/src/javascript/JS_Value.h",
654       "fpdfsdk/src/javascript/PublicMethods.cpp",
655       "fpdfsdk/src/javascript/PublicMethods.h",
656       "fpdfsdk/src/javascript/app.cpp",
657       "fpdfsdk/src/javascript/app.h",
658       "fpdfsdk/src/javascript/color.cpp",
659       "fpdfsdk/src/javascript/color.h",
660       "fpdfsdk/src/javascript/console.cpp",
661       "fpdfsdk/src/javascript/console.h",
662       "fpdfsdk/src/javascript/event.cpp",
663       "fpdfsdk/src/javascript/event.h",
664       "fpdfsdk/src/javascript/global.cpp",
665       "fpdfsdk/src/javascript/global.h",
666       "fpdfsdk/src/javascript/report.cpp",
667       "fpdfsdk/src/javascript/report.h",
668       "fpdfsdk/src/javascript/resource.cpp",
669       "fpdfsdk/src/javascript/resource.h",
670       "fpdfsdk/src/javascript/util.cpp",
671       "fpdfsdk/src/javascript/util.h",
672       "fpdfsdk/include/jsapi/fxjs_v8.h",
673       "fpdfsdk/src/jsapi/fxjs_v8.cpp",
674     ]
675     include_dirs = [
676       "//v8",
677       "//v8/include",
678     ]
679     public_deps = [
680       "//v8",
681     ]
682   } else {
683     sources += [ "fpdfsdk/src/javascript/JS_Runtime_Stub.cpp" ]
684   }
685   configs += [ ":pdfium_config" ]
686 }
687
688 static_library("formfiller") {
689   sources = [
690     "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h",
691     "fpdfsdk/include/formfiller/FFL_CheckBox.h",
692     "fpdfsdk/include/formfiller/FFL_ComboBox.h",
693     "fpdfsdk/include/formfiller/FFL_FormFiller.h",
694     "fpdfsdk/include/formfiller/FFL_IFormFiller.h",
695     "fpdfsdk/include/formfiller/FFL_ListBox.h",
696     "fpdfsdk/include/formfiller/FFL_PushButton.h",
697     "fpdfsdk/include/formfiller/FFL_RadioButton.h",
698     "fpdfsdk/include/formfiller/FFL_TextField.h",
699     "fpdfsdk/include/formfiller/FormFiller.h",
700     "fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp",
701     "fpdfsdk/src/formfiller/FFL_CheckBox.cpp",
702     "fpdfsdk/src/formfiller/FFL_ComboBox.cpp",
703     "fpdfsdk/src/formfiller/FFL_FormFiller.cpp",
704     "fpdfsdk/src/formfiller/FFL_IFormFiller.cpp",
705     "fpdfsdk/src/formfiller/FFL_ListBox.cpp",
706     "fpdfsdk/src/formfiller/FFL_PushButton.cpp",
707     "fpdfsdk/src/formfiller/FFL_RadioButton.cpp",
708     "fpdfsdk/src/formfiller/FFL_TextField.cpp",
709   ]
710   configs += [ ":pdfium_config" ]
711 }
712
713 test("pdfium_unittests") {
714   sources = [
715     "core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp",
716     "core/src/fxcrt/fx_basic_bstring_unittest.cpp",
717     "core/src/fxcrt/fx_basic_memmgr_unittest.cpp",
718     "core/src/fxcrt/fx_basic_wstring_unittest.cpp",
719     "core/src/fxcrt/fx_bidi_unittest.cpp",
720     "core/src/fxcrt/fx_system_unittest.cpp",
721     "third_party/base/nonstd_unique_ptr_unittest.cpp",
722   ]
723   deps = [
724     "//testing/gtest",
725     "//testing/gtest:gtest_main",
726     ":pdfium",
727     ":test_support",
728   ]
729   include_dirs = [ "." ]
730   configs += [ ":pdfium_config" ]
731 }
732
733 test("pdfium_embeddertests") {
734   sources = [
735     "core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp",
736     "core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp",
737     "core/src/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp",
738     "fpdfsdk/src/fpdf_dataavail_embeddertest.cpp",
739     "fpdfsdk/src/fpdfdoc_embeddertest.cpp",
740     "fpdfsdk/src/fpdfformfill_embeddertest.cpp",
741     "fpdfsdk/src/fpdftext_embeddertest.cpp",
742     "fpdfsdk/src/fpdfview_c_api_test.c",
743     "fpdfsdk/src/fpdfview_c_api_test.h",
744     "fpdfsdk/src/fpdfview_embeddertest.cpp",
745     "testing/embedder_test.cpp",
746     "testing/embedder_test.h",
747     "testing/embedder_test_mock_delegate.h",
748     "testing/embedder_test_timer_handling_delegate.h",
749   ]
750   deps = [
751     "//testing/gmock",
752     "//testing/gtest",
753     ":pdfium",
754     ":test_support",
755   ]
756   include_dirs = [
757     "."
758   ]
759   if (pdf_enable_v8) {
760     sources += [
761      "fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp"
762     ]
763     deps += [
764       "//v8",
765       "//v8:v8_libplatform",
766     ]
767     include_dirs += [
768       "//v8",
769       "//v8/include",
770     ]
771   }
772   configs += [ ":pdfium_config" ]
773 }