1# 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
5import("../../pdfium.gni")
6import("../../testing/test.gni")
7
8source_set("fxcodec") {
9  sources = [
10    "basic/basicmodule.cpp",
11    "basic/basicmodule.h",
12    "cfx_codec_memory.cpp",
13    "cfx_codec_memory.h",
14    "codec_module_iface.h",
15    "fax/faxmodule.cpp",
16    "fax/faxmodule.h",
17    "flate/flatemodule.cpp",
18    "flate/flatemodule.h",
19    "fx_codec.cpp",
20    "fx_codec.h",
21    "fx_codec_def.h",
22    "icc/iccmodule.cpp",
23    "icc/iccmodule.h",
24    "jbig2/JBig2_ArithDecoder.cpp",
25    "jbig2/JBig2_ArithDecoder.h",
26    "jbig2/JBig2_ArithIntDecoder.cpp",
27    "jbig2/JBig2_ArithIntDecoder.h",
28    "jbig2/JBig2_BitStream.cpp",
29    "jbig2/JBig2_BitStream.h",
30    "jbig2/JBig2_Context.cpp",
31    "jbig2/JBig2_Context.h",
32    "jbig2/JBig2_Define.h",
33    "jbig2/JBig2_DocumentContext.cpp",
34    "jbig2/JBig2_DocumentContext.h",
35    "jbig2/JBig2_GrdProc.cpp",
36    "jbig2/JBig2_GrdProc.h",
37    "jbig2/JBig2_GrrdProc.cpp",
38    "jbig2/JBig2_GrrdProc.h",
39    "jbig2/JBig2_HtrdProc.cpp",
40    "jbig2/JBig2_HtrdProc.h",
41    "jbig2/JBig2_HuffmanDecoder.cpp",
42    "jbig2/JBig2_HuffmanDecoder.h",
43    "jbig2/JBig2_HuffmanTable.cpp",
44    "jbig2/JBig2_HuffmanTable.h",
45    "jbig2/JBig2_Image.cpp",
46    "jbig2/JBig2_Image.h",
47    "jbig2/JBig2_Page.h",
48    "jbig2/JBig2_PatternDict.cpp",
49    "jbig2/JBig2_PatternDict.h",
50    "jbig2/JBig2_PddProc.cpp",
51    "jbig2/JBig2_PddProc.h",
52    "jbig2/JBig2_SddProc.cpp",
53    "jbig2/JBig2_SddProc.h",
54    "jbig2/JBig2_Segment.cpp",
55    "jbig2/JBig2_Segment.h",
56    "jbig2/JBig2_SymbolDict.cpp",
57    "jbig2/JBig2_SymbolDict.h",
58    "jbig2/JBig2_TrdProc.cpp",
59    "jbig2/JBig2_TrdProc.h",
60    "jbig2/jbig2module.cpp",
61    "jbig2/jbig2module.h",
62    "jpeg/jpegmodule.cpp",
63    "jpeg/jpegmodule.h",
64    "jpx/cjpx_decoder.cpp",
65    "jpx/cjpx_decoder.h",
66    "jpx/jpx_decode_utils.cpp",
67    "jpx/jpx_decode_utils.h",
68    "jpx/jpxmodule.cpp",
69    "jpx/jpxmodule.h",
70    "scanlinedecoder.cpp",
71    "scanlinedecoder.h",
72  ]
73  configs += [ "../../:pdfium_core_config" ]
74  include_dirs = []
75  deps = [
76    "../../third_party:lcms2",
77    "../../third_party:libopenjpeg2",
78    "../../third_party:zlib",
79    "../fxcrt",
80    "../fxge",
81    "//third_party:jpeg",
82  ]
83
84  if (pdf_enable_xfa) {
85    sources += [
86      "progressivedecoder.cpp",
87      "progressivedecoder.h",
88    ]
89    if (pdf_enable_xfa_bmp) {
90      sources += [
91        "bmp/bmpmodule.cpp",
92        "bmp/bmpmodule.h",
93        "bmp/cfx_bmpcontext.cpp",
94        "bmp/cfx_bmpcontext.h",
95        "bmp/cfx_bmpdecompressor.cpp",
96        "bmp/cfx_bmpdecompressor.h",
97        "bmp/fx_bmp.h",
98      ]
99    }
100    if (pdf_enable_xfa_gif) {
101      sources += [
102        "gif/cfx_gif.cpp",
103        "gif/cfx_gif.h",
104        "gif/cfx_gifcontext.cpp",
105        "gif/cfx_gifcontext.h",
106        "gif/cfx_lzwdecompressor.cpp",
107        "gif/cfx_lzwdecompressor.h",
108        "gif/gifmodule.cpp",
109        "gif/gifmodule.h",
110      ]
111    }
112    if (pdf_enable_xfa_png) {
113      sources += [
114        "png/pngmodule.cpp",
115        "png/pngmodule.h",
116      ]
117      deps += [ "../../third_party:png" ]
118    }
119    if (pdf_enable_xfa_tiff) {
120      sources += [
121        "tiff/tiffmodule.cpp",
122        "tiff/tiffmodule.h",
123      ]
124      deps += [ "../../third_party:fx_tiff" ]
125    }
126  }
127
128  visibility = [ "../../*" ]
129}
130
131pdfium_unittest_source_set("unittests") {
132  sources = [
133    "basic/a85_unittest.cpp",
134    "basic/rle_unittest.cpp",
135    "jbig2/JBig2_BitStream_unittest.cpp",
136    "jbig2/JBig2_Image_unittest.cpp",
137    "jpx/jpx_unittest.cpp",
138  ]
139  deps = [
140    ":fxcodec",
141    "../fpdfapi/parser",
142  ]
143  pdfium_root_dir = "../../"
144
145  if (pdf_enable_xfa) {
146    sources += [ "progressivedecoder_unittest.cpp" ]
147    deps += [ "../fxge" ]
148    if (pdf_enable_xfa_gif) {
149      sources += [
150        "gif/cfx_gifcontext_unittest.cpp",
151        "gif/cfx_lzwdecompressor_unittest.cpp",
152      ]
153    }
154  }
155}
156
157pdfium_embeddertest_source_set("embeddertests") {
158  sources = [ "jbig2/jbig2_embeddertest.cpp" ]
159  pdfium_root_dir = "../../"
160}
161