blob: 265e1be4b93dfd52b69bf6762ead73368271270c [file] [log] [blame]
load(
"//bazel:skia_rules.bzl",
"exports_files_legacy",
"generate_cpp_files_for_header_list",
"skia_cc_library",
"skia_filegroup",
)
licenses(["notice"])
exports_files_legacy(
label_list = ["SkBitmaskEnum.h"],
visibility = ["//tools/skui:__pkg__"],
)
# Headers with no corresponding .cpp files
IWYU_HDRS = [
"SkASAN.h",
"SkArenaAllocList.h",
"SkBitmaskEnum.h",
"SkEndian.h",
"SkEnumBitMask.h",
"SkLeanWindows.h",
"SkMSAN.h",
"SkNoDestructor.h",
"SkRandom.h",
"SkRectMemcpy.h",
"SkScopeExit.h",
"SkStringView.h",
"SkTBlockList.h",
"SkTDPQueue.h",
"SkTInternalLList.h",
"SkTLazy.h",
"SkTSort.h",
"SkZip.h",
]
skia_filegroup(
name = "private_hdrs",
srcs = IWYU_HDRS + [
"SkArenaAlloc.h",
"SkAutoMalloc.h",
"SkBase64.h",
"SkBezierCurves.h",
"SkBlockAllocator.h",
"SkBuffer.h",
"SkCubics.h",
"SkHalf.h",
"SkMathPriv.h",
"SkQuads.h",
"SkSafeMath.h",
"SkSharedMutex.h",
"SkSpinlock.h",
"SkTSearch.h",
"SkTime.h",
"SkUTF.h",
"SkUtils.h",
"SkVx.h", # Causes IWYU to crash when compiling.
],
visibility = [
"//src:__pkg__",
"//src/opts:__pkg__",
],
)
generate_cpp_files_for_header_list(
name = "generated_base_header_cpps",
headers = IWYU_HDRS,
visibility = ["//src:__pkg__"],
)
# In a separate file group because these files are exported to sksl.gni:skslc_deps.
skia_filegroup(
name = "skslc_srcs",
srcs = [
"SkArenaAlloc.cpp",
"SkBlockAllocator.cpp",
"SkContainers.cpp",
"SkHalf.cpp",
"SkMalloc.cpp",
"SkMathPriv.cpp",
"SkSafeMath.cpp",
"SkSemaphore.cpp",
"SkThreadID.cpp",
"SkUTF.cpp",
"SkUtils.cpp",
],
)
skia_filegroup(
name = "srcs",
srcs = [
"SkBase64.cpp",
"SkBezierCurves.cpp",
"SkBuffer.cpp",
"SkCubics.cpp",
"SkDebug.cpp",
"SkDeque.cpp",
"SkFloatingPoint.cpp",
"SkQuads.cpp",
"SkSharedMutex.cpp",
"SkSpinlock.cpp",
"SkTDArray.cpp",
"SkTSearch.cpp",
"SkTime.cpp",
":skslc_srcs",
],
visibility = [
"//src:__pkg__",
],
)
skia_cc_library(
name = "base",
srcs = [
":srcs",
"//src/ports:base_srcs",
] + select({
"//bazel/common_config_settings:compile_generated_cpp_files_for_headers_true": [
":generated_base_header_cpps",
"//include/private/base:generated_base_header_cpps",
],
"//conditions:default": [],
}),
hdrs = [
":private_hdrs",
"//include/private/base:private_hdrs",
],
features = ["layering_check"],
visibility = [
"//bench:__subpackages__",
"//modules:__subpackages__",
"//src:__subpackages__",
"//tests:__subpackages__",
"//tools:__subpackages__",
],
deps = ["@skia_user_config//:user_config"],
)