skia2/BUILD.bazel
Kevin Lubick 96e4053be7 Update Bazel files
- Use latest emscripten toolchain (3.1.0)
 - Autogenerate the atoms and manually fix some of the file lists.
 - Add a known_good_builds target to bazel/Makefile to help
   check the things we expect to work with Bazel.

Change-Id: Ia5f51e7b9eb5c108386820ad59180c8f862f5a70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491438
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-01-06 18:10:57 +00:00

137 lines
3.3 KiB
Python

# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//bazel:macros.bzl", "select_multi")
load("@bazel_gazelle//:def.bzl", "gazelle")
package(default_visibility = ["//:__subpackages__"])
selects.config_setting_group(
name = "needs_jpeg",
match_any = [
"//bazel/common_config_settings:raw_decode_codec",
"//bazel/common_config_settings:jpeg_decode_codec",
"//bazel/common_config_settings:jpeg_encode_codec",
],
)
selects.config_setting_group(
name = "needs_png",
match_any = [
"//bazel/common_config_settings:png_decode_codec",
"//bazel/common_config_settings:png_encode_codec",
],
)
selects.config_setting_group(
name = "needs_webp",
match_any = [
"//bazel/common_config_settings:webp_decode_codec",
"//bazel/common_config_settings:webp_encode_codec",
],
)
selects.config_setting_group(
name = "any_freetype_fontmgr",
match_any = [
"//bazel/common_config_settings:custom_directory_fontmgr",
"//bazel/common_config_settings:custom_embedded_fontmgr",
"//bazel/common_config_settings:custom_empty_fontmgr",
],
)
CORE_DEPS = [
"//src/android:srcs",
"//src/codec:srcs",
"//src/core:srcs",
"//src/image:srcs",
"//src/images:srcs",
"//src/effects:srcs",
"//src/opts:srcs",
"//src/pathops:srcs",
"//src/ports:srcs",
"//src/sfnt:srcs",
"//src/shaders:srcs",
"//src/utils:srcs",
"//third_party:skcms",
] + selects.with_or({
# https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectswith_or
("//bazel/common_config_settings:gl_backend", "//bazel/common_config_settings:vulkan_backend"): [
"//src/gpu:srcs",
"//src/sksl:srcs",
# TODO(kjlubick) should mock be test only?
"//src/gpu:mock_srcs",
],
"//conditions:default": [],
}) + select_multi(
{
"//bazel/common_config_settings:gif_decode_codec": ["//third_party:wuffs"],
":needs_png": ["//third_party:libpng"],
"//bazel/common_config_settings:raw_decode_codec": [
"//third_party:piex",
"//third_party:dng_sdk",
],
":needs_webp": ["//third_party:libwebp"],
":needs_jpeg": ["//third_party:libjpeg-turbo"],
},
default = [],
) + select({
":any_freetype_fontmgr": [
"//third_party:freetype2",
],
"//conditions:default": [],
})
cc_library(
name = "skia_core",
textual_hdrs = ["//src/sksl:txts"],
deps = CORE_DEPS,
)
cc_library(
name = "hash_and_encode",
testonly = True,
srcs = [
"//tools:cmdline",
"//tools:hash_and_encode",
],
deps = [
":skia-core",
"//third_party:libpng",
],
)
cc_library(
name = "gms",
testonly = True,
srcs = [
"//gm:gms",
"//gm:srcs",
"//tools:srcs",
],
hdrs = [
"//gm:hdrs",
],
textual_hdrs = ["//tools:txts"],
deps = [":skia-core"],
)
cc_library(
name = "tests",
testonly = True,
srcs = [
"//tests:srcs",
"//tools:srcs",
],
hdrs = [
"//tests:hdrs",
],
local_defines = [
"GR_TEST_UTILS",
],
textual_hdrs = ["//tools:txts"],
deps = [":skia-core"],
)
# gazelle:prefix go.skia.org/skia
gazelle(name = "gazelle")