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