blob: 429228199e56d3b8b9ef00c12304a063161a6fcf [file] [log] [blame]
load("//bazel:macros.bzl", "exports_files_legacy", "select_multi", "skia_cc_deps", "skia_filegroup", "string_flag_with_values")
licenses(["notice"])
exports_files_legacy()
string_flag_with_values(
name = "include_encoder",
multiple = True,
values = [
"jpeg_encode_codec",
"png_encode_codec",
"webp_encode_codec",
],
)
# In separate skia_filegroup from "srcs" to prevent these files from being
# exported to GNI.
skia_filegroup(
name = "optional_srcs",
srcs = select_multi({
":jpeg_encode_codec": [
"SkJPEGWriteUtility.cpp",
"SkJpegEncoder.cpp",
],
":png_encode_codec": ["SkPngEncoder.cpp"],
":webp_encode_codec": ["SkWebpEncoder.cpp"],
}),
)
skia_filegroup(
name = "srcs",
srcs = [
"SkImageEncoder.cpp",
":optional_srcs",
],
visibility = ["//src:__pkg__"],
)
skia_filegroup(
name = "private_hdrs",
srcs = [
"SkImageEncoderFns.h",
"SkImageEncoderPriv.h",
] + select({
":jpeg_encode_codec": ["SkJPEGWriteUtility.h"],
"//conditions:default": [],
}),
visibility = ["//src:__pkg__"],
)
skia_cc_deps(
name = "deps",
visibility = ["//src:__pkg__"],
deps = select_multi(
{
":jpeg_encode_codec": ["@libjpeg_turbo"],
":png_encode_codec": ["@libpng"],
":webp_encode_codec": ["@libwebp"],
},
),
)