| load("//bazel:macros.bzl", "bool_flag", "exports_files_legacy", "selects", "skia_cc_deps", "skia_filegroup", "split_srcs_and_hdrs") |
| |
| licenses(["notice"]) |
| |
| exports_files_legacy() |
| |
| PDF_FILES = [ |
| "SkBitmapKey.h", |
| "SkClusterator.cpp", |
| "SkClusterator.h", |
| "SkDeflate.cpp", |
| "SkDeflate.h", |
| "SkJpegInfo.cpp", |
| "SkJpegInfo.h", |
| "SkKeyedImage.cpp", |
| "SkKeyedImage.h", |
| "SkPDFBitmap.cpp", |
| "SkPDFBitmap.h", |
| "SkPDFDevice.cpp", |
| "SkPDFDevice.h", |
| "SkPDFDocument.cpp", |
| "SkPDFDocumentPriv.h", |
| "SkPDFFont.cpp", |
| "SkPDFFont.h", |
| "SkPDFFormXObject.cpp", |
| "SkPDFFormXObject.h", |
| "SkPDFGlyphUse.h", |
| "SkPDFGradientShader.cpp", |
| "SkPDFGradientShader.h", |
| "SkPDFGraphicStackState.cpp", |
| "SkPDFGraphicStackState.h", |
| "SkPDFGraphicState.cpp", |
| "SkPDFGraphicState.h", |
| "SkPDFMakeCIDGlyphWidthsArray.cpp", |
| "SkPDFMakeCIDGlyphWidthsArray.h", |
| "SkPDFMakeToUnicodeCmap.cpp", |
| "SkPDFMakeToUnicodeCmap.h", |
| "SkPDFMetadata.cpp", |
| "SkPDFMetadata.h", |
| "SkPDFResourceDict.cpp", |
| "SkPDFResourceDict.h", |
| "SkPDFShader.cpp", |
| "SkPDFShader.h", |
| "SkPDFSubsetFont.cpp", |
| "SkPDFSubsetFont.h", |
| "SkPDFTag.cpp", |
| "SkPDFTag.h", |
| "SkPDFType1Font.cpp", |
| "SkPDFType1Font.h", |
| "SkPDFTypes.cpp", |
| "SkPDFTypes.h", |
| "SkPDFUnion.h", |
| "SkPDFUtils.cpp", |
| "SkPDFUtils.h", |
| "SkUUID.h", |
| ] |
| |
| split_srcs_and_hdrs( |
| name = "pdf", |
| files = PDF_FILES, |
| ) |
| |
| skia_filegroup( |
| name = "srcs", |
| srcs = [ |
| ":pdf_srcs", |
| ], |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "private_hdrs", |
| srcs = [ |
| ":pdf_hdrs", |
| ], |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| bool_flag( |
| name = "enable_pdf_backend", |
| default = False, |
| ) |
| |
| bool_flag( |
| name = "enable_pdf_subset_harfbuzz", |
| default = True, # This defaults it to be on if icu and harfbuzz are on |
| ) |
| |
| selects.config_setting_group( |
| name = "uses_jpeg", |
| match_any = [ |
| "//src/images:jpeg_encode_codec", |
| "//src/codec:jpeg_decode_codec", |
| ], |
| ) |
| |
| selects.config_setting_group( |
| name = "uses_harfbuzz", |
| match_all = [ |
| "//bazel/common_config_settings:use_icu_true", |
| "//bazel/common_config_settings:use_harfbuzz_true", |
| ":enable_pdf_subset_harfbuzz_true", |
| ], |
| ) |
| |
| # TODO(kjlubick) sfntly support |
| |
| skia_cc_deps( |
| name = "deps", |
| visibility = ["//src:__pkg__"], |
| deps = ["@zlib_skia//:zlib"] + select({ |
| ":uses_jpeg": ["@libjpeg_turbo"], |
| "//conditions:default": [], |
| }) + select({ |
| ":uses_harfbuzz": ["@harfbuzz"], |
| "//conditions:default": [], |
| }), |
| ) |