xref: /aosp_15_r20/external/pdfium/core/fxge/BUILD.gn (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1# Copyright 2018 The PDFium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/freetype/freetype.gni")
6import("../../pdfium.gni")
7import("../../testing/test.gni")
8
9source_set("fxge") {
10  sources = [
11    "agg/fx_agg_driver.cpp",
12    "agg/fx_agg_driver.h",
13    "calculate_pitch.cpp",
14    "calculate_pitch.h",
15    "cfx_cliprgn.cpp",
16    "cfx_cliprgn.h",
17    "cfx_color.cpp",
18    "cfx_color.h",
19    "cfx_defaultrenderdevice.cpp",
20    "cfx_defaultrenderdevice.h",
21    "cfx_drawutils.cpp",
22    "cfx_drawutils.h",
23    "cfx_face.cpp",
24    "cfx_face.h",
25    "cfx_fillrenderoptions.h",
26    "cfx_folderfontinfo.cpp",
27    "cfx_folderfontinfo.h",
28    "cfx_font.cpp",
29    "cfx_font.h",
30    "cfx_fontcache.cpp",
31    "cfx_fontcache.h",
32    "cfx_fontmapper.cpp",
33    "cfx_fontmapper.h",
34    "cfx_fontmgr.cpp",
35    "cfx_fontmgr.h",
36    "cfx_gemodule.cpp",
37    "cfx_gemodule.h",
38    "cfx_glyphbitmap.cpp",
39    "cfx_glyphbitmap.h",
40    "cfx_glyphcache.cpp",
41    "cfx_glyphcache.h",
42    "cfx_graphstate.cpp",
43    "cfx_graphstate.h",
44    "cfx_graphstatedata.cpp",
45    "cfx_graphstatedata.h",
46    "cfx_path.cpp",
47    "cfx_path.h",
48    "cfx_renderdevice.cpp",
49    "cfx_renderdevice.h",
50    "cfx_substfont.cpp",
51    "cfx_substfont.h",
52    "cfx_textrenderoptions.h",
53    "cfx_unicodeencoding.cpp",
54    "cfx_unicodeencoding.h",
55    "dib/cfx_bitmapcomposer.cpp",
56    "dib/cfx_bitmapcomposer.h",
57    "dib/cfx_bitmapstorer.cpp",
58    "dib/cfx_bitmapstorer.h",
59    "dib/cfx_cmyk_to_srgb.cpp",
60    "dib/cfx_cmyk_to_srgb.h",
61    "dib/cfx_dibbase.cpp",
62    "dib/cfx_dibbase.h",
63    "dib/cfx_dibitmap.cpp",
64    "dib/cfx_dibitmap.h",
65    "dib/cfx_imagerenderer.cpp",
66    "dib/cfx_imagerenderer.h",
67    "dib/cfx_imagestretcher.cpp",
68    "dib/cfx_imagestretcher.h",
69    "dib/cfx_imagetransformer.cpp",
70    "dib/cfx_imagetransformer.h",
71    "dib/cfx_scanlinecompositor.cpp",
72    "dib/cfx_scanlinecompositor.h",
73    "dib/cstretchengine.cpp",
74    "dib/cstretchengine.h",
75    "dib/fx_dib.cpp",
76    "dib/fx_dib.h",
77    "dib/scanlinecomposer_iface.h",
78    "fontdata/chromefontdata/FoxitDingbats.cpp",
79    "fontdata/chromefontdata/FoxitFixed.cpp",
80    "fontdata/chromefontdata/FoxitFixedBold.cpp",
81    "fontdata/chromefontdata/FoxitFixedBoldItalic.cpp",
82    "fontdata/chromefontdata/FoxitFixedItalic.cpp",
83    "fontdata/chromefontdata/FoxitSans.cpp",
84    "fontdata/chromefontdata/FoxitSansBold.cpp",
85    "fontdata/chromefontdata/FoxitSansBoldItalic.cpp",
86    "fontdata/chromefontdata/FoxitSansItalic.cpp",
87    "fontdata/chromefontdata/FoxitSansMM.cpp",
88    "fontdata/chromefontdata/FoxitSerif.cpp",
89    "fontdata/chromefontdata/FoxitSerifBold.cpp",
90    "fontdata/chromefontdata/FoxitSerifBoldItalic.cpp",
91    "fontdata/chromefontdata/FoxitSerifItalic.cpp",
92    "fontdata/chromefontdata/FoxitSerifMM.cpp",
93    "fontdata/chromefontdata/FoxitSymbol.cpp",
94    "fontdata/chromefontdata/chromefontdata.h",
95    "freetype/fx_freetype.cpp",
96    "freetype/fx_freetype.h",
97    "fx_font.cpp",
98    "fx_font.h",
99    "render_defines.h",
100    "renderdevicedriver_iface.cpp",
101    "renderdevicedriver_iface.h",
102    "scoped_font_transform.cpp",
103    "scoped_font_transform.h",
104    "systemfontinfo_iface.h",
105    "text_char_pos.cpp",
106    "text_char_pos.h",
107    "text_glyph_pos.cpp",
108    "text_glyph_pos.h",
109  ]
110
111  configs += [
112    "../../:pdfium_strict_config",
113    "../../:pdfium_noshorten_config",
114  ]
115
116  deps = [
117    "../../third_party:fx_agg",
118    "../fxcrt",
119  ]
120
121  public_deps = []
122
123  if (is_component_build || use_system_freetype) {
124    # ft_adobe_glyph_list is not exported from the Freetype shared library so we
125    # need it defined in component builds and builds using system freetype.
126    defines = [ "DEFINE_PS_TABLES_DATA" ]
127  }
128
129  if (pdf_enable_xfa) {
130    sources += [
131      "cfx_unicodeencodingex.cpp",
132      "cfx_unicodeencodingex.h",
133    ]
134  }
135
136  if (pdf_use_skia) {
137    sources += [
138      "skia/cfx_dibbase_skia.cpp",
139      "skia/fx_skia_device.cpp",
140    ]
141    public_deps += [ "//skia" ]
142  }
143
144  if (is_android) {
145    sources += [
146      "android/cfpf_skiadevicemodule.cpp",
147      "android/cfpf_skiadevicemodule.h",
148      "android/cfpf_skiafont.cpp",
149      "android/cfpf_skiafont.h",
150      "android/cfpf_skiafontmgr.cpp",
151      "android/cfpf_skiafontmgr.h",
152      "android/cfpf_skiapathfont.cpp",
153      "android/cfpf_skiapathfont.h",
154      "android/cfx_androidfontinfo.cpp",
155      "android/cfx_androidfontinfo.h",
156      "android/fx_android_impl.cpp",
157    ]
158  }
159
160  if (is_linux || is_chromeos || is_fuchsia) {
161    sources += [ "linux/fx_linux_impl.cpp" ]
162  }
163
164  if (is_mac) {
165    sources += [
166      "apple/fx_apple_impl.cpp",
167      "apple/fx_apple_platform.cpp",
168      "apple/fx_apple_platform.h",
169      "apple/fx_quartz_device.cpp",
170      "apple/fx_quartz_device.h",
171    ]
172    frameworks = [ "CoreGraphics.framework" ]
173  }
174
175  if (is_win) {
176    sources += [
177      "cfx_windowsrenderdevice.cpp",
178      "cfx_windowsrenderdevice.h",
179      "win32/cfx_psfonttracker.cpp",
180      "win32/cfx_psfonttracker.h",
181      "win32/cfx_psrenderer.cpp",
182      "win32/cfx_psrenderer.h",
183      "win32/cgdi_device_driver.cpp",
184      "win32/cgdi_device_driver.h",
185      "win32/cgdi_display_driver.cpp",
186      "win32/cgdi_display_driver.h",
187      "win32/cgdi_plus_ext.cpp",
188      "win32/cgdi_plus_ext.h",
189      "win32/cgdi_printer_driver.cpp",
190      "win32/cgdi_printer_driver.h",
191      "win32/cps_printer_driver.cpp",
192      "win32/cps_printer_driver.h",
193      "win32/cpsoutput.cpp",
194      "win32/cpsoutput.h",
195      "win32/ctext_only_printer_driver.cpp",
196      "win32/ctext_only_printer_driver.h",
197      "win32/cwin32_platform.cpp",
198      "win32/cwin32_platform.h",
199    ]
200    configs -= [ "//build/config/win:lean_and_mean" ]
201  }
202
203  visibility = [ "../../*" ]
204}
205
206pdfium_unittest_source_set("unittests") {
207  sources = [
208    "cfx_defaultrenderdevice_unittest.cpp",
209    "cfx_folderfontinfo_unittest.cpp",
210    "cfx_fontmapper_unittest.cpp",
211    "cfx_path_unittest.cpp",
212    "dib/cfx_cmyk_to_srgb_unittest.cpp",
213    "dib/cfx_dibbase_unittest.cpp",
214    "dib/cfx_dibitmap_unittest.cpp",
215    "dib/cstretchengine_unittest.cpp",
216    "fx_font_unittest.cpp",
217  ]
218  deps = [
219    ":fxge",
220    "../fpdfapi/page",
221    "../fpdfapi/parser",
222  ]
223  pdfium_root_dir = "../../"
224
225  if (is_win) {
226    sources += [ "win32/cfx_psrenderer_unittest.cpp" ]
227  }
228}
229
230pdfium_embeddertest_source_set("embeddertests") {
231  sources = [ "fx_ge_text_embeddertest.cpp" ]
232  deps = []
233  pdfium_root_dir = "../../"
234
235  if (pdf_use_skia) {
236    sources += [ "skia/fx_skia_device_embeddertest.cpp" ]
237    deps += [
238      ":fxge",
239      "../../fpdfsdk",
240      "../fpdfapi/page",
241      "../fpdfapi/render",
242      "//skia",
243    ]
244  }
245
246  if (is_win) {
247    sources += [ "cfx_windowsrenderdevice_embeddertest.cpp" ]
248    deps += [
249      ":fxge",
250      "../fxcodec",
251    ]
252  }
253}
254