blob: c692bc1dd9584c3d83510c1792cf66da9ac3d832 [file] [log] [blame]
load(
"//bazel:skia_rules.bzl",
"exports_files_legacy",
"generate_cpp_files_for_headers",
"skia_cc_deps",
"skia_cc_library",
"skia_filegroup",
)
licenses(["notice"])
exports_files_legacy()
skia_filegroup(
name = "srcs",
srcs = [
"//src/android:srcs",
"//src/base:srcs",
"//src/codec:srcs",
"//src/core:srcs",
"//src/effects:srcs",
"//src/image:srcs",
"//src/encode:srcs",
"//src/pathops:srcs",
"//src/ports:srcs",
"//src/sfnt:srcs",
"//src/shaders:srcs",
"//src/text:srcs",
"//src/utils:srcs",
] + select({
"//src/gpu:has_gpu_backend": [
"//src/gpu:srcs",
"//src/text/gpu:srcs",
],
"//conditions:default": [],
}) + select({
"//src/sksl:needs_sksl": ["//src/sksl:srcs"],
"//conditions:default": [],
}) + select({
"//src/svg:enable_svg_canvas_true": [
"//src/svg:srcs",
"//src/xml:srcs",
],
"//conditions:default": [],
}) + select({
"//src/pdf:enable_pdf_backend_true": ["//src/pdf:srcs"],
"//conditions:default": [],
}) + select({
"//src/lazy:enable_discardable_memory_true": ["//src/lazy:srcs"],
"//conditions:default": [],
}) + select({
"//bazel/common_config_settings:compile_generated_cpp_files_for_headers_true": [
":generated_srcs",
],
"//conditions:default": [],
}),
visibility = ["//:__pkg__"],
)
skia_filegroup(
name = "private_hdrs",
srcs = [
"//src/base:private_hdrs",
"//src/codec:private_hdrs",
"//src/core:private_hdrs",
"//src/effects:private_hdrs",
"//src/image:private_hdrs",
"//src/encode:private_hdrs",
"//src/opts:private_hdrs",
"//src/pathops:private_hdrs",
"//src/ports:private_hdrs",
"//src/sfnt:private_hdrs",
"//src/shaders:private_hdrs",
"//src/text:private_hdrs",
"//src/utils:private_hdrs",
] + select({
"//src/gpu:has_gpu_backend": [
"//src/gpu:private_hdrs",
"//src/text/gpu:private_hdrs",
],
"//conditions:default": [],
}) + select({
"//src/sksl:needs_sksl": ["//src/sksl:private_hdrs"],
"//conditions:default": [],
}) + select({
"//src/svg:enable_svg_canvas_true": [
"//src/svg:private_hdrs",
"//src/xml:private_hdrs",
],
"//conditions:default": [],
}) + select({
"//src/pdf:enable_pdf_backend_true": ["//src/pdf:private_hdrs"],
"//conditions:default": [],
}) + select({
"//src/lazy:enable_discardable_memory_true": ["//src/lazy:private_hdrs"],
"//conditions:default": [],
}),
visibility = [
"//:__pkg__",
"//src/opts:__pkg__",
],
)
skia_cc_deps(
name = "deps",
visibility = ["//:__pkg__"],
deps = [
"//src/codec:deps",
"//src/encode:deps",
"//src/ports:deps",
"//src/opts:deps",
"//modules/skcms:skcms",
] + select({
"//src/gpu:has_gpu_backend": ["//src/gpu:deps"],
"//conditions:default": [],
}) + select({
"//src/sksl:needs_sksl": ["//src/sksl:deps"],
"//conditions:default": [],
}) + select({
"//src/svg:enable_svg_canvas_true": ["//src/xml:deps"],
"//conditions:default": [],
}) + select({
"//src/pdf:enable_pdf_backend_true": ["//src/pdf:deps"],
"//conditions:default": [],
}),
)
generate_cpp_files_for_headers(
name = "generated_srcs",
headers = [
":private_hdrs",
],
# All headers listed here (using paths relative to the Skia root) will have a .cpp file
# generated that is a copy of the header file just with a .cpp suffix so Bazel will try to
# compile it. This allows us to run IWYU on these files.
to_generate = [
"src/core/SkColorSpacePriv.h",
"src/core/SkDrawProcs.h",
"src/core/SkICCPriv.h",
"src/core/SkMatrixPriv.h",
"src/core/SkPathPriv.h",
"src/encode/SkImageEncoderFns.h",
"src/encode/SkImageEncoderPriv.h",
"src/image/SkImage_Base.h",
],
)
####################################################################
# Experimental buffet build below
skia_cc_library(
name = "base",
srcs = [
"//include/config:public_hdrs",
"//src/base:srcs",
] + select({
"//bazel/common_config_settings:compile_generated_cpp_files_for_headers_true": [
"//include/private/base:generated_base_header_cpps",
"//src/base:generated_base_header_cpps",
],
"//conditions:default": [],
}),
hdrs = [
"//include/private/base:private_hdrs",
"//src/base:private_hdrs",
],
features = ["layering_check"],
visibility = ["//src:__subpackages__"],
)
skia_cc_library(
name = "core",
srcs = [
"//include/private:buffet_hdrs",
"//include/private:buffet_srcs",
"//src/core:buffet_hdrs",
"//src/core:buffet_srcs",
],
hdrs = ["//include/core:core_hdrs"],
visibility = ["//:__pkg__"],
deps = [":base"],
)
skia_cc_library(
name = "core_priv",
hdrs = [
"//include/private:buffet_hdrs",
"//src/core:buffet_hdrs",
],
visibility = ["//src:__subpackages__"],
deps = [":base"],
)
skia_cc_library(
name = "pathops",
srcs = [
"//src/pathops:private_hdrs",
"//src/pathops:srcs",
],
hdrs = [
"//include/pathops:public_hdrs",
],
features = ["layering_check"],
visibility = ["//:__subpackages__"],
deps = [
":base",
":core",
":core_priv",
],
)