DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (d96ee8115c5a)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

with Files('**'):
    BUG_COMPONENT = ('Core', 'Printing: Output')

LOCAL_INCLUDES += [
    'pdfium',
]

# pdfium_common_config
DEFINES['OPJ_STATIC'] = True
DEFINES['PNG_PREFIX'] = True
DEFINES['PNG_USE_READ_MACROS'] = True
if CONFIG['OS_TARGET'] == 'WINNT':
    DEFINES['PDFIUM_PRINT_TEXT_WITH_GDI'] = True

# pdfium_core_config
DEFINES['V8_DEPRECATION_WARNINGS'] = True
if CONFIG['OS_ARCH'] == 'Linux':
    if CONFIG['CPU_ARCH'] == 'x86_64':
        DEFINES['_FX_CPU_'] = '_FX_X64_'
    elif CONFIG['CPU_ARCH'] == 'x86':
        DEFINES['_FX_CPU_'] = '_FX_X86_'

# pdfium
UNIFIED_SOURCES += [
    'pdfium/fpdfsdk/cba_annotiterator.cpp',
    'pdfium/fpdfsdk/cfx_systemhandler.cpp',
    'pdfium/fpdfsdk/cpdfsdk_annot.cpp',
    'pdfium/fpdfsdk/cpdfsdk_annothandlermgr.cpp',
    'pdfium/fpdfsdk/cpdfsdk_annotiteration.cpp',
    'pdfium/fpdfsdk/cpdfsdk_baannot.cpp',
    'pdfium/fpdfsdk/cpdfsdk_baannothandler.cpp',
    'pdfium/fpdfsdk/cpdfsdk_datetime.cpp',
    'pdfium/fpdfsdk/cpdfsdk_formfillenvironment.cpp',
    'pdfium/fpdfsdk/cpdfsdk_interform.cpp',
    'pdfium/fpdfsdk/cpdfsdk_pageview.cpp',
    'pdfium/fpdfsdk/cpdfsdk_widget.cpp',
    'pdfium/fpdfsdk/cpdfsdk_widgethandler.cpp',
    'pdfium/fpdfsdk/fpdf_dataavail.cpp',
    'pdfium/fpdfsdk/fpdf_ext.cpp',
    'pdfium/fpdfsdk/fpdf_flatten.cpp',
    'pdfium/fpdfsdk/fpdf_progressive.cpp',
    'pdfium/fpdfsdk/fpdf_searchex.cpp',
    'pdfium/fpdfsdk/fpdf_structtree.cpp',
    'pdfium/fpdfsdk/fpdf_sysfontinfo.cpp',
    'pdfium/fpdfsdk/fpdf_transformpage.cpp',
    'pdfium/fpdfsdk/fpdfdoc.cpp',
    'pdfium/fpdfsdk/fpdfeditimg.cpp',
    'pdfium/fpdfsdk/fpdfeditpage.cpp',
    'pdfium/fpdfsdk/fpdfeditpath.cpp',
    'pdfium/fpdfsdk/fpdfedittext.cpp',
    'pdfium/fpdfsdk/fpdfformfill.cpp',
    'pdfium/fpdfsdk/fpdfppo.cpp',
    'pdfium/fpdfsdk/fpdfsave.cpp',
    'pdfium/fpdfsdk/fpdftext.cpp',
    'pdfium/fpdfsdk/fpdfview.cpp',
    'pdfium/fpdfsdk/fsdk_actionhandler.cpp',
    'pdfium/fpdfsdk/fsdk_pauseadapter.cpp',
    'pdfium/fpdfsdk/pdfsdk_fieldaction.cpp',
]
if CONFIG['OS_TARGET'] == 'WINNT':
    OS_LIBS += [
        'advapi32',
        'gdi32',
        'user32',
    ]

# fdrm
UNIFIED_SOURCES += [
    'pdfium/core/fdrm/crypto/fx_crypt_aes.cpp',
]
SOURCES += [
    # not able to be unified because of the error:
    # - 'GET_UINT32': macro redefinition
    # - 'PUT_UINT32': macro redefinition
    # - 'P': macro redefinition
    'pdfium/core/fdrm/crypto/fx_crypt.cpp',
    'pdfium/core/fdrm/crypto/fx_crypt_sha.cpp',
]

# formfiller
UNIFIED_SOURCES += [
    'pdfium/fpdfsdk/formfiller/cba_fontmap.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_checkbox.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_combobox.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_formfiller.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_listbox.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_pushbutton.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_radiobutton.cpp',
    'pdfium/fpdfsdk/formfiller/cffl_textfield.cpp',
]

# fpdfapi
UNIFIED_SOURCES += [
    'pdfium/core/fpdfapi/cmaps/CNS1/Adobe-CNS1-UCS2_5.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/B5pc-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/B5pc-V_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/cmaps_cns1.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/CNS-EUC-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/CNS-EUC-V_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/ETen-B5-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/ETen-B5-V_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/ETenms-B5-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/ETenms-B5-V_0.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/HKscs-B5-H_5.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/HKscs-B5-V_5.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/UniCNS-UCS2-H_3.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/UniCNS-UCS2-V_3.cpp',
    'pdfium/core/fpdfapi/cmaps/CNS1/UniCNS-UTF16-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/fpdf_cmaps.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/Adobe-GB1-UCS2_5.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/cmaps_gb1.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GB-EUC-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GB-EUC-V_0.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBK-EUC-H_2.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBK-EUC-V_2.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBK2K-H_5.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBK2K-V_5.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBKp-EUC-H_2.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBKp-EUC-V_2.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBpc-EUC-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/GBpc-EUC-V_0.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/UniGB-UCS2-H_4.cpp',
    'pdfium/core/fpdfapi/cmaps/GB1/UniGB-UCS2-V_4.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/83pv-RKSJ-H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/90ms-RKSJ-H_2.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/90ms-RKSJ-V_2.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/90msp-RKSJ-H_2.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/90msp-RKSJ-V_2.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/90pv-RKSJ-H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/Add-RKSJ-H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/Add-RKSJ-V_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/cmaps_japan1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/EUC-H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/EUC-V_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/Ext-RKSJ-H_2.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/Ext-RKSJ-V_2.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/UniJIS-UCS2-H_4.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/UniJIS-UCS2-HW-H_4.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/UniJIS-UCS2-V_4.cpp',
    'pdfium/core/fpdfapi/cmaps/Japan1/V_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/cmaps_korea1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/KSC-EUC-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/KSC-EUC-V_0.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/KSCms-UHC-H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/KSCms-UHC-HW-H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/KSCms-UHC-HW-V_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/KSCms-UHC-V_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/KSCpc-EUC-H_0.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/UniKS-UCS2-H_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/UniKS-UCS2-V_1.cpp',
    'pdfium/core/fpdfapi/cmaps/Korea1/UniKS-UTF16-H_0.cpp',
    'pdfium/core/fpdfapi/cpdf_modulemgr.cpp',
    'pdfium/core/fpdfapi/cpdf_pagerendercontext.cpp',
    'pdfium/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp',
    'pdfium/core/fpdfapi/edit/fpdf_edit_create.cpp',
    'pdfium/core/fpdfapi/font/cpdf_cidfont.cpp',
    'pdfium/core/fpdfapi/font/cpdf_font.cpp',
    'pdfium/core/fpdfapi/font/cpdf_fontencoding.cpp',
    'pdfium/core/fpdfapi/font/cpdf_simplefont.cpp',
    'pdfium/core/fpdfapi/font/cpdf_truetypefont.cpp',
    'pdfium/core/fpdfapi/font/cpdf_type1font.cpp',
    'pdfium/core/fpdfapi/font/cpdf_type3char.cpp',
    'pdfium/core/fpdfapi/font/cpdf_type3font.cpp',
    'pdfium/core/fpdfapi/font/fpdf_font.cpp',
    'pdfium/core/fpdfapi/font/fpdf_font_cid.cpp',
    'pdfium/core/fpdfapi/font/ttgsubtable.cpp',
    'pdfium/core/fpdfapi/page/cpdf_allstates.cpp',
    'pdfium/core/fpdfapi/page/cpdf_clippath.cpp',
    'pdfium/core/fpdfapi/page/cpdf_color.cpp',
    'pdfium/core/fpdfapi/page/cpdf_colorspace.cpp',
    'pdfium/core/fpdfapi/page/cpdf_colorstate.cpp',
    'pdfium/core/fpdfapi/page/cpdf_contentmark.cpp',
    'pdfium/core/fpdfapi/page/cpdf_contentmarkitem.cpp',
    'pdfium/core/fpdfapi/page/cpdf_contentparser.cpp',
    'pdfium/core/fpdfapi/page/cpdf_docpagedata.cpp',
    'pdfium/core/fpdfapi/page/cpdf_form.cpp',
    'pdfium/core/fpdfapi/page/cpdf_formobject.cpp',
    'pdfium/core/fpdfapi/page/cpdf_generalstate.cpp',
    'pdfium/core/fpdfapi/page/cpdf_graphicstates.cpp',
    'pdfium/core/fpdfapi/page/cpdf_image.cpp',
    'pdfium/core/fpdfapi/page/cpdf_imageobject.cpp',
    'pdfium/core/fpdfapi/page/cpdf_meshstream.cpp',
    'pdfium/core/fpdfapi/page/cpdf_page.cpp',
    'pdfium/core/fpdfapi/page/cpdf_pagemodule.cpp',
    'pdfium/core/fpdfapi/page/cpdf_pageobject.cpp',
    'pdfium/core/fpdfapi/page/cpdf_pageobjectholder.cpp',
    'pdfium/core/fpdfapi/page/cpdf_pageobjectlist.cpp',
    'pdfium/core/fpdfapi/page/cpdf_path.cpp',
    'pdfium/core/fpdfapi/page/cpdf_pathobject.cpp',
    'pdfium/core/fpdfapi/page/cpdf_pattern.cpp',
    'pdfium/core/fpdfapi/page/cpdf_shadingobject.cpp',
    'pdfium/core/fpdfapi/page/cpdf_shadingpattern.cpp',
    'pdfium/core/fpdfapi/page/cpdf_streamcontentparser.cpp',
    'pdfium/core/fpdfapi/page/cpdf_streamparser.cpp',
    'pdfium/core/fpdfapi/page/cpdf_textobject.cpp',
    'pdfium/core/fpdfapi/page/cpdf_textstate.cpp',
    'pdfium/core/fpdfapi/page/cpdf_tilingpattern.cpp',
    'pdfium/core/fpdfapi/page/fpdf_page_colors.cpp',
    'pdfium/core/fpdfapi/page/fpdf_page_func.cpp',
    'pdfium/core/fpdfapi/parser/cfdf_document.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_array.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_boolean.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_crypto_handler.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_data_avail.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_dictionary.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_document.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_hint_tables.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_linearized_header.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_name.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_null.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_number.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_object.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_parser.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_reference.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_security_handler.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_simple_parser.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_stream.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_stream_acc.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_string.cpp',
    'pdfium/core/fpdfapi/parser/cpdf_syntax_parser.cpp',
    'pdfium/core/fpdfapi/parser/fpdf_parser_decode.cpp',
    'pdfium/core/fpdfapi/parser/fpdf_parser_utility.cpp',
    'pdfium/core/fpdfapi/render/cpdf_charposlist.cpp',
    'pdfium/core/fpdfapi/render/cpdf_devicebuffer.cpp',
    'pdfium/core/fpdfapi/render/cpdf_dibtransferfunc.cpp',
    'pdfium/core/fpdfapi/render/cpdf_docrenderdata.cpp',
    'pdfium/core/fpdfapi/render/cpdf_imagecacheentry.cpp',
    'pdfium/core/fpdfapi/render/cpdf_imageloader.cpp',
    'pdfium/core/fpdfapi/render/cpdf_imagerenderer.cpp',
    'pdfium/core/fpdfapi/render/cpdf_pagerendercache.cpp',
    'pdfium/core/fpdfapi/render/cpdf_progressiverenderer.cpp',
    'pdfium/core/fpdfapi/render/cpdf_rendercontext.cpp',
    'pdfium/core/fpdfapi/render/cpdf_renderoptions.cpp',
    'pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp',
    'pdfium/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp',
    'pdfium/core/fpdfapi/render/cpdf_textrenderer.cpp',
    'pdfium/core/fpdfapi/render/cpdf_transferfunc.cpp',
    'pdfium/core/fpdfapi/render/cpdf_type3cache.cpp',
    'pdfium/core/fpdfapi/render/cpdf_type3glyphs.cpp',
]
SOURCES += [
    # not able to be unified because of the error:
    # - '`anonymous-namespace'::kMaxImageDimension': redefinition; different storage class
    'pdfium/core/fpdfapi/render/cpdf_dibsource.cpp',
]

# fpdfdoc
UNIFIED_SOURCES += [
    'pdfium/core/fpdfdoc/cline.cpp',
    'pdfium/core/fpdfdoc/clines.cpp',
    'pdfium/core/fpdfdoc/cpdf_aaction.cpp',
    'pdfium/core/fpdfdoc/cpdf_action.cpp',
    'pdfium/core/fpdfdoc/cpdf_actionfields.cpp',
    'pdfium/core/fpdfdoc/cpdf_annot.cpp',
    'pdfium/core/fpdfdoc/cpdf_annotlist.cpp',
    'pdfium/core/fpdfdoc/cpdf_apsettings.cpp',
    'pdfium/core/fpdfdoc/cpdf_bookmark.cpp',
    'pdfium/core/fpdfdoc/cpdf_bookmarktree.cpp',
    'pdfium/core/fpdfdoc/cpdf_defaultappearance.cpp',
    'pdfium/core/fpdfdoc/cpdf_dest.cpp',
    'pdfium/core/fpdfdoc/cpdf_docjsactions.cpp',
    'pdfium/core/fpdfdoc/cpdf_filespec.cpp',
    'pdfium/core/fpdfdoc/cpdf_formcontrol.cpp',
    'pdfium/core/fpdfdoc/cpdf_formfield.cpp',
    'pdfium/core/fpdfdoc/cpdf_iconfit.cpp',
    'pdfium/core/fpdfdoc/cpdf_link.cpp',
    'pdfium/core/fpdfdoc/cpdf_linklist.cpp',
    'pdfium/core/fpdfdoc/cpdf_metadata.cpp',
    'pdfium/core/fpdfdoc/cpdf_numbertree.cpp',
    'pdfium/core/fpdfdoc/cpdf_occontext.cpp',
    'pdfium/core/fpdfdoc/cpdf_pagelabel.cpp',
    'pdfium/core/fpdfdoc/cpdf_variabletext.cpp',
    'pdfium/core/fpdfdoc/cpdf_viewerpreferences.cpp',
    'pdfium/core/fpdfdoc/cpvt_color.cpp',
    'pdfium/core/fpdfdoc/cpvt_fontmap.cpp',
    'pdfium/core/fpdfdoc/cpvt_generateap.cpp',
    'pdfium/core/fpdfdoc/cpvt_sectioninfo.cpp',
    'pdfium/core/fpdfdoc/cpvt_wordinfo.cpp',
    'pdfium/core/fpdfdoc/csection.cpp',
    'pdfium/core/fpdfdoc/ctypeset.cpp',
]
SOURCES += [
    # not able to be unified because of the error:
    # - '`anonymous-namespace'::nMaxRecursion': redefinition; different storage class
    'pdfium/core/fpdfdoc/cpdf_interform.cpp',
    'pdfium/core/fpdfdoc/cpdf_nametree.cpp',
    'pdfium/core/fpdfdoc/doc_tagged.cpp',
]

# fpdftext
UNIFIED_SOURCES += [
    'pdfium/core/fpdftext/cpdf_linkextract.cpp',
    'pdfium/core/fpdftext/cpdf_textpage.cpp',
    'pdfium/core/fpdftext/cpdf_textpagefind.cpp',
    'pdfium/core/fpdftext/unicodenormalizationdata.cpp',
]

# fxcodec
UNIFIED_SOURCES += [
    'pdfium/core/fxcodec/codec/fx_codec.cpp',
    'pdfium/core/fxcodec/codec/fx_codec_flate.cpp',
    'pdfium/core/fxcodec/codec/fx_codec_icc.cpp',
    'pdfium/core/fxcodec/codec/fx_codec_jbig.cpp',
    'pdfium/core/fxcodec/codec/fx_codec_jpeg.cpp',
#    'pdfium/core/fxcodec/codec/fx_codec_jpx_opj.cpp',  # SkiaPDF doesn't use JPEG 2000 format
    'pdfium/core/fxcodec/jbig2/JBig2_ArithDecoder.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_BitStream.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_Context.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_GrdProc.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_GrrdProc.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_GsidProc.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_HtrdProc.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_HuffmanTable_Standard.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_Image.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_PatternDict.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_PddProc.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_SddProc.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_Segment.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_SymbolDict.cpp',
    'pdfium/core/fxcodec/jbig2/JBig2_TrdProc.cpp',
]
SOURCES += [
    # not able to be unified because of the error:
    # - '`anonymous-namespace'::kMaxImageDimension': redefinition; different storage class
    'pdfium/core/fxcodec/codec/fx_codec_fax.cpp',
]

# fxcrt
UNIFIED_SOURCES += [
    'pdfium/core/fxcrt/fx_basic_array.cpp',
    'pdfium/core/fxcrt/fx_basic_bstring.cpp',
    'pdfium/core/fxcrt/fx_basic_buffer.cpp',
    'pdfium/core/fxcrt/fx_basic_coords.cpp',
    'pdfium/core/fxcrt/fx_basic_gcc.cpp',
    'pdfium/core/fxcrt/fx_basic_memmgr.cpp',
    'pdfium/core/fxcrt/fx_basic_utf.cpp',
    'pdfium/core/fxcrt/fx_basic_util.cpp',
    'pdfium/core/fxcrt/fx_basic_wstring.cpp',
    'pdfium/core/fxcrt/fx_bidi.cpp',
    'pdfium/core/fxcrt/fx_extension.cpp',
    'pdfium/core/fxcrt/fx_ucddata.cpp',
    'pdfium/core/fxcrt/fx_unicode.cpp',
    'pdfium/core/fxcrt/fx_xml_composer.cpp',
    'pdfium/core/fxcrt/fx_xml_parser.cpp',
    'pdfium/core/fxcrt/fxcrt_posix.cpp',
    'pdfium/core/fxcrt/fxcrt_stream.cpp',
    'pdfium/core/fxcrt/fxcrt_windows.cpp',
]

# fxedit
UNIFIED_SOURCES += [
    'pdfium/fpdfsdk/fxedit/fxet_ap.cpp',
    'pdfium/fpdfsdk/fxedit/fxet_edit.cpp',
    'pdfium/fpdfsdk/fxedit/fxet_list.cpp',
]

# fxge
UNIFIED_SOURCES += [
    'pdfium/core/fxge/agg/fx_agg_driver.cpp',
    'pdfium/core/fxge/dib/fx_dib_composite.cpp',
    'pdfium/core/fxge/dib/fx_dib_convert.cpp',
    'pdfium/core/fxge/dib/fx_dib_engine.cpp',
    'pdfium/core/fxge/dib/fx_dib_main.cpp',
    'pdfium/core/fxge/dib/fx_dib_transform.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitDingbats.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitFixed.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedBold.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedBoldItalic.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedItalic.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSans.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSansBold.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSansBoldItalic.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSansItalic.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSansMM.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSerif.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSerifBold.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSerifBoldItalic.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSerifItalic.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSerifMM.cpp',
    'pdfium/core/fxge/fontdata/chromefontdata/FoxitSymbol.cpp',
    'pdfium/core/fxge/freetype/fx_freetype.cpp',
    'pdfium/core/fxge/ge/cfx_cliprgn.cpp',
    'pdfium/core/fxge/ge/cfx_facecache.cpp',
    'pdfium/core/fxge/ge/cfx_folderfontinfo.cpp',
    'pdfium/core/fxge/ge/cfx_font.cpp',
    'pdfium/core/fxge/ge/cfx_fontcache.cpp',
    'pdfium/core/fxge/ge/cfx_fontmapper.cpp',
    'pdfium/core/fxge/ge/cfx_fontmgr.cpp',
    'pdfium/core/fxge/ge/cfx_gemodule.cpp',
    'pdfium/core/fxge/ge/cfx_graphstate.cpp',
    'pdfium/core/fxge/ge/cfx_graphstatedata.cpp',
    'pdfium/core/fxge/ge/cfx_pathdata.cpp',
    'pdfium/core/fxge/ge/cfx_renderdevice.cpp',
    'pdfium/core/fxge/ge/cfx_substfont.cpp',
    'pdfium/core/fxge/ge/cfx_unicodeencoding.cpp',
    'pdfium/core/fxge/ge/cttfontdesc.cpp',
    'pdfium/core/fxge/ge/fx_ge_fontmap.cpp',
    'pdfium/core/fxge/ge/fx_ge_linux.cpp',
    'pdfium/core/fxge/ge/fx_ge_text.cpp',
    'pdfium/core/fxge/ifx_renderdevicedriver.cpp',
]
if CONFIG['OS_TARGET'] == 'WINNT':
    UNIFIED_SOURCES += [
        'pdfium/core/fxge/win32/cfx_psrenderer.cpp',
        'pdfium/core/fxge/win32/cpsoutput.cpp',
        'pdfium/core/fxge/win32/fx_win32_device.cpp',
        'pdfium/core/fxge/win32/fx_win32_dib.cpp',
        'pdfium/core/fxge/win32/fx_win32_print.cpp',
    ]
    SOURCES += [
        # not able to be unified because of the error:
        # - 'boolean': redefinition; different basic types
        # - 'BOOLEAN': redefinition; different basic types
        'pdfium/core/fxge/win32/fx_win32_dwrite.cpp',
    ]
    SOURCES += [
        # avoid other files being polluted by WIN32_LEAN_AND_MEAN macro
        'pdfium/core/fxge/win32/fx_win32_gdipext.cpp',
    ]
if CONFIG['OS_TARGET'] == 'Darwin':
    UNIFIED_SOURCES += [
        'pdfium/core/fxge/apple/fx_apple_platform.cpp',
        'pdfium/core/fxge/apple/fx_mac_imp.cpp',
        'pdfium/core/fxge/apple/fx_quartz_device.cpp',
    ]
if CONFIG['OS_TARGET'] == 'Android':
    UNIFIED_SOURCES += [
        'pdfium/core/fxge/android/cfpf_skiadevicemodule.cpp',
        'pdfium/core/fxge/android/cfpf_skiafont.cpp',
        'pdfium/core/fxge/android/cfpf_skiafontmgr.cpp',
        'pdfium/core/fxge/android/cfx_androidfontinfo.cpp',
        'pdfium/core/fxge/android/fx_android_imp.cpp',
    ]

# javascript
UNIFIED_SOURCES += [
    'pdfium/fpdfsdk/javascript/JS_Runtime_Stub.cpp',
]

# pdfwindow
UNIFIED_SOURCES += [
    'pdfium/fpdfsdk/pdfwindow/cpwl_color.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_Button.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_Caret.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_ComboBox.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_Edit.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_FontMap.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_Icon.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_ListBox.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_Utils.cpp',
    'pdfium/fpdfsdk/pdfwindow/PWL_Wnd.cpp',
]

# third_party:fx_agg
UNIFIED_SOURCES += [
    'pdfium/third_party/agg23/agg_curves.cpp',
    'pdfium/third_party/agg23/agg_path_storage.cpp',
    'pdfium/third_party/agg23/agg_rasterizer_scanline_aa.cpp',
    'pdfium/third_party/agg23/agg_vcgen_dash.cpp',
    'pdfium/third_party/agg23/agg_vcgen_stroke.cpp',
]

# third_party:bigint
UNIFIED_SOURCES += [
    'pdfium/third_party/bigint/BigIntegerUtils.cc',
    'pdfium/third_party/bigint/BigUnsignedInABase.cc',
]
SOURCES += [
    # not able to be unified because of the error:
    # - 'DTRT_ALIASED': macro redefinition
    'pdfium/third_party/bigint/BigInteger.cc',
    'pdfium/third_party/bigint/BigUnsigned.cc',
]

# third_party:fx_freetype
LOCAL_INCLUDES += [
    '/modules/freetype2/include',
    '/modules/freetype2/src',
]
USE_LIBS += [
    'freetype',
]

# third_party:fx_lcms2
UNIFIED_SOURCES += [
    'pdfium/third_party/lcms2-2.6/src/cmscam02.c',
    'pdfium/third_party/lcms2-2.6/src/cmscgats.c',
    'pdfium/third_party/lcms2-2.6/src/cmscnvrt.c',
    'pdfium/third_party/lcms2-2.6/src/cmserr.c',
    'pdfium/third_party/lcms2-2.6/src/cmsgamma.c',
    'pdfium/third_party/lcms2-2.6/src/cmsgmt.c',
    'pdfium/third_party/lcms2-2.6/src/cmshalf.c',
    'pdfium/third_party/lcms2-2.6/src/cmsintrp.c',
    'pdfium/third_party/lcms2-2.6/src/cmsio0.c',
    'pdfium/third_party/lcms2-2.6/src/cmsio1.c',
    'pdfium/third_party/lcms2-2.6/src/cmslut.c',
    'pdfium/third_party/lcms2-2.6/src/cmsmd5.c',
    'pdfium/third_party/lcms2-2.6/src/cmsmtrx.c',
    'pdfium/third_party/lcms2-2.6/src/cmsopt.c',
    'pdfium/third_party/lcms2-2.6/src/cmspack.c',
    'pdfium/third_party/lcms2-2.6/src/cmspcs.c',
    'pdfium/third_party/lcms2-2.6/src/cmsplugin.c',
    'pdfium/third_party/lcms2-2.6/src/cmssamp.c',
    'pdfium/third_party/lcms2-2.6/src/cmssm.c',
    'pdfium/third_party/lcms2-2.6/src/cmsvirt.c',
    'pdfium/third_party/lcms2-2.6/src/cmswtpnt.c',
    'pdfium/third_party/lcms2-2.6/src/cmsxform.c',
]
SOURCES += [
    # not able to be unified because of the error:
    # - function 'cmsUInt32Number mywcslen(const wchar_t *)' already has a body
    'pdfium/third_party/lcms2-2.6/src/cmsnamed.c',

    # not able to be unified because of the error:
    # - 'WriteCLUT': redefinition; different basic types
    'pdfium/third_party/lcms2-2.6/src/cmsps2.c',

    # not able to be unified because of the error:
    # - function 'cmsUInt32Number mywcslen(const wchar_t *)' already has a body
    # - 'WriteCLUT': redefinition; different basic types
    'pdfium/third_party/lcms2-2.6/src/cmstypes.c',
]

# third_party:fx_zlib
LOCAL_INCLUDES += [
    '/modules/zlib/src',
]
USE_LIBS += [
    'zlib',
]

# third_party:jpeg
DEFINES['USE_LIBJPEG_TURBO'] = True
LOCAL_INCLUDES += [
    '/media/libjpeg',
]
USE_LIBS += [
    'media_libjpeg',
]

# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()

GeckoSharedLibrary('pdfium', linkage=None)

if CONFIG['OS_TARGET'] == 'WINNT':
    DEFFILE = SRCDIR + '/pdfium.def'