blob: df96eb19e95a609296d66a588dba9e3265c37cf9 [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001# Copyright 2018 The PDFium Authors
Lei Zhang84600882018-10-12 18:58:21 +00002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Lei Zhang84600882018-10-12 18:58:21 +00005import("../../pdfium.gni")
Lei Zhangf03f7812018-10-15 23:48:29 +00006import("../../testing/test.gni")
Lei Zhang84600882018-10-12 18:58:21 +00007
Daniel Hosseinian0fab9e62019-11-01 19:31:49 +00008source_set("fxcodec") {
Lei Zhang84600882018-10-12 18:58:21 +00009 sources = [
Lei Zhangffa67dd2019-06-17 20:27:52 +000010 "basic/basicmodule.cpp",
11 "basic/basicmodule.h",
Lei Zhangf98c54d2024-05-16 05:20:15 +000012 "data_and_bytes_consumed.cpp",
13 "data_and_bytes_consumed.h",
Lei Zhangffa67dd2019-06-17 20:27:52 +000014 "fax/faxmodule.cpp",
15 "fax/faxmodule.h",
16 "flate/flatemodule.cpp",
17 "flate/flatemodule.h",
Lei Zhang016aff62019-06-14 17:27:19 +000018 "fx_codec.cpp",
Lei Zhang84600882018-10-12 18:58:21 +000019 "fx_codec.h",
20 "fx_codec_def.h",
Tom Sepez8c67c6f2021-09-01 01:28:27 +000021 "icc/icc_transform.cpp",
22 "icc/icc_transform.h",
Lei Zhang84600882018-10-12 18:58:21 +000023 "jbig2/JBig2_ArithDecoder.cpp",
24 "jbig2/JBig2_ArithDecoder.h",
25 "jbig2/JBig2_ArithIntDecoder.cpp",
26 "jbig2/JBig2_ArithIntDecoder.h",
27 "jbig2/JBig2_BitStream.cpp",
28 "jbig2/JBig2_BitStream.h",
29 "jbig2/JBig2_Context.cpp",
30 "jbig2/JBig2_Context.h",
31 "jbig2/JBig2_Define.h",
Lei Zhangffa67dd2019-06-17 20:27:52 +000032 "jbig2/JBig2_DocumentContext.cpp",
33 "jbig2/JBig2_DocumentContext.h",
Lei Zhang84600882018-10-12 18:58:21 +000034 "jbig2/JBig2_GrdProc.cpp",
35 "jbig2/JBig2_GrdProc.h",
36 "jbig2/JBig2_GrrdProc.cpp",
37 "jbig2/JBig2_GrrdProc.h",
38 "jbig2/JBig2_HtrdProc.cpp",
39 "jbig2/JBig2_HtrdProc.h",
40 "jbig2/JBig2_HuffmanDecoder.cpp",
41 "jbig2/JBig2_HuffmanDecoder.h",
42 "jbig2/JBig2_HuffmanTable.cpp",
43 "jbig2/JBig2_HuffmanTable.h",
44 "jbig2/JBig2_Image.cpp",
45 "jbig2/JBig2_Image.h",
46 "jbig2/JBig2_Page.h",
47 "jbig2/JBig2_PatternDict.cpp",
48 "jbig2/JBig2_PatternDict.h",
49 "jbig2/JBig2_PddProc.cpp",
50 "jbig2/JBig2_PddProc.h",
51 "jbig2/JBig2_SddProc.cpp",
52 "jbig2/JBig2_SddProc.h",
53 "jbig2/JBig2_Segment.cpp",
54 "jbig2/JBig2_Segment.h",
55 "jbig2/JBig2_SymbolDict.cpp",
56 "jbig2/JBig2_SymbolDict.h",
57 "jbig2/JBig2_TrdProc.cpp",
58 "jbig2/JBig2_TrdProc.h",
Lei Zhang37b80452020-05-15 18:08:33 +000059 "jbig2/jbig2_decoder.cpp",
60 "jbig2/jbig2_decoder.h",
Lei Zhang01b618f2020-05-15 03:35:54 +000061 "jpeg/jpeg_common.cpp",
62 "jpeg/jpeg_common.h",
Lei Zhangffa67dd2019-06-17 20:27:52 +000063 "jpeg/jpegmodule.cpp",
64 "jpeg/jpegmodule.h",
65 "jpx/cjpx_decoder.cpp",
66 "jpx/cjpx_decoder.h",
Lei Zhang20707712019-06-17 20:29:12 +000067 "jpx/jpx_decode_utils.cpp",
68 "jpx/jpx_decode_utils.h",
Lei Zhang91b2faf2019-06-17 20:31:12 +000069 "scanlinedecoder.cpp",
70 "scanlinedecoder.h",
Lei Zhang84600882018-10-12 18:58:21 +000071 ]
Tom Sepez926cd3c2022-02-14 20:38:35 +000072 configs += [
73 "../../:pdfium_strict_config",
74 "../../:pdfium_noshorten_config",
75 ]
Lei Zhang37935952024-02-16 04:39:56 +000076 public_deps = [ "../fxcrt" ]
Lei Zhang84600882018-10-12 18:58:21 +000077 deps = [
Lei Zhang84600882018-10-12 18:58:21 +000078 "../../third_party:lcms2",
Felix Kauselmann8d72a472019-02-13 23:44:56 +000079 "../../third_party:libopenjpeg2",
Lei Zhang84600882018-10-12 18:58:21 +000080 "../../third_party:zlib",
Lei Zhang966e10c2018-10-15 19:33:26 +000081 "../fxge",
Lei Zhang84600882018-10-12 18:58:21 +000082 "//third_party:jpeg",
83 ]
Lei Zhang84600882018-10-12 18:58:21 +000084 if (pdf_enable_xfa) {
85 sources += [
Lei Zhang4937f862024-05-21 16:21:11 +000086 "cfx_codec_memory.cpp",
87 "cfx_codec_memory.h",
Lei Zhang01b618f2020-05-15 03:35:54 +000088 "jpeg/jpeg_progressive_decoder.cpp",
89 "jpeg/jpeg_progressive_decoder.h",
Lei Zhang30cb9e62020-05-15 21:26:26 +000090 "progressive_decoder.cpp",
91 "progressive_decoder.h",
Lei Zhang45125c82020-05-15 03:32:24 +000092 "progressive_decoder_iface.h",
Lei Zhang84600882018-10-12 18:58:21 +000093 ]
94 if (pdf_enable_xfa_bmp) {
95 sources += [
Lei Zhangc90401b2020-05-15 21:16:27 +000096 "bmp/bmp_decoder.cpp",
97 "bmp/bmp_decoder.h",
Lei Zhang0332bf32020-05-15 21:05:06 +000098 "bmp/bmp_progressive_decoder.cpp",
99 "bmp/bmp_progressive_decoder.h",
Lei Zhang84600882018-10-12 18:58:21 +0000100 "bmp/cfx_bmpcontext.cpp",
101 "bmp/cfx_bmpcontext.h",
102 "bmp/cfx_bmpdecompressor.cpp",
103 "bmp/cfx_bmpdecompressor.h",
Lei Zhang84600882018-10-12 18:58:21 +0000104 "bmp/fx_bmp.h",
Lei Zhang84600882018-10-12 18:58:21 +0000105 ]
106 }
107 if (pdf_enable_xfa_gif) {
108 sources += [
Lei Zhang84600882018-10-12 18:58:21 +0000109 "gif/cfx_gif.cpp",
110 "gif/cfx_gif.h",
111 "gif/cfx_gifcontext.cpp",
112 "gif/cfx_gifcontext.h",
Lei Zhang380174f2020-05-15 20:06:36 +0000113 "gif/gif_decoder.cpp",
114 "gif/gif_decoder.h",
Lei Zhang94210262020-05-15 20:04:46 +0000115 "gif/gif_progressive_decoder.cpp",
116 "gif/gif_progressive_decoder.h",
Tom Sepezdab11612021-05-19 22:29:17 +0000117 "gif/lzw_decompressor.cpp",
118 "gif/lzw_decompressor.h",
Lei Zhang84600882018-10-12 18:58:21 +0000119 ]
120 }
121 if (pdf_enable_xfa_png) {
122 sources += [
Lei Zhang7017a852020-05-15 18:50:03 +0000123 "png/png_decoder.cpp",
124 "png/png_decoder.h",
Lei Zhang84600882018-10-12 18:58:21 +0000125 ]
126 deps += [ "../../third_party:png" ]
127 }
128 if (pdf_enable_xfa_tiff) {
129 sources += [
Lei Zhang19628c02020-05-15 18:25:43 +0000130 "tiff/tiff_decoder.cpp",
131 "tiff/tiff_decoder.h",
Lei Zhang84600882018-10-12 18:58:21 +0000132 ]
Lei Zhang97af7302023-03-31 23:13:38 +0000133 deps += [ "../../third_party:tiff" ]
Lei Zhang84600882018-10-12 18:58:21 +0000134 }
135 }
Lei Zhangb65d1562019-05-28 19:26:42 +0000136
Lei Zhang84600882018-10-12 18:58:21 +0000137 visibility = [ "../../*" ]
138}
Lei Zhangf03f7812018-10-15 23:48:29 +0000139
140pdfium_unittest_source_set("unittests") {
141 sources = [
Lei Zhang79b28472019-06-17 20:32:18 +0000142 "basic/a85_unittest.cpp",
143 "basic/rle_unittest.cpp",
Nico Weberd324c722023-11-30 23:49:05 +0000144 "flate/flatemodule_unittest.cpp",
Lei Zhangf03f7812018-10-15 23:48:29 +0000145 "jbig2/JBig2_BitStream_unittest.cpp",
146 "jbig2/JBig2_Image_unittest.cpp",
Lei Zhang79b28472019-06-17 20:32:18 +0000147 "jpx/jpx_unittest.cpp",
Lei Zhangf03f7812018-10-15 23:48:29 +0000148 ]
149 deps = [
150 ":fxcodec",
Lei Zhangcff6cfc2020-06-10 18:55:18 +0000151 "../../third_party:libopenjpeg2",
Lei Zhangf03f7812018-10-15 23:48:29 +0000152 "../fpdfapi/parser",
153 ]
154 pdfium_root_dir = "../../"
155
Lei Zhangbae830f2019-05-30 20:57:50 +0000156 if (pdf_enable_xfa) {
Lei Zhang30cb9e62020-05-15 21:26:26 +0000157 sources += [ "progressive_decoder_unittest.cpp" ]
Lei Zhangbae830f2019-05-30 20:57:50 +0000158 deps += [ "../fxge" ]
159 if (pdf_enable_xfa_gif) {
160 sources += [
161 "gif/cfx_gifcontext_unittest.cpp",
Tom Sepezdab11612021-05-19 22:29:17 +0000162 "gif/lzw_decompressor_unittest.cpp",
Lei Zhangbae830f2019-05-30 20:57:50 +0000163 ]
164 }
Lei Zhangf03f7812018-10-15 23:48:29 +0000165 }
166}
Lei Zhang1929d6e2018-10-15 23:51:28 +0000167
168pdfium_embeddertest_source_set("embeddertests") {
Lei Zhang40f9d722020-01-24 00:18:11 +0000169 sources = [ "jbig2/jbig2_embeddertest.cpp" ]
Lei Zhang1929d6e2018-10-15 23:51:28 +0000170 pdfium_root_dir = "../../"
171}