1load( 2 "//bazel:skia_rules.bzl", 3 "generate_cpp_files_for_headers", 4 "skia_cc_library", 5 "skia_filegroup", 6) 7 8package( 9 default_applicable_licenses = ["//:license"], 10) 11 12licenses(["notice"]) 13 14# Headers with no corresponding .cpp files 15IWYU_HDRS = [ 16 "SkArenaAllocList.h", 17 "SkBitmaskEnum.h", 18 "SkEndian.h", 19 "SkEnumBitMask.h", 20 "SkFixedArray.h", 21 "SkFloatBits.h", 22 "SkLeanWindows.h", 23 "SkMSAN.h", 24 "SkNoDestructor.h", 25 "SkRandom.h", 26 "SkRectMemcpy.h", 27 "SkScopeExit.h", 28 "SkStringView.h", 29 "SkTBlockList.h", 30 "SkTDPQueue.h", 31 "SkTInternalLList.h", 32 "SkTLazy.h", 33 "SkTSort.h", 34 "SkZip.h", 35] 36 37skia_filegroup( 38 name = "private_hdrs", 39 srcs = IWYU_HDRS + [ 40 "SkArenaAlloc.h", 41 "SkAutoMalloc.h", 42 "SkBase64.h", 43 "SkBezierCurves.h", 44 "SkBlockAllocator.h", 45 "SkBuffer.h", 46 "SkCubics.h", 47 "SkHalf.h", 48 "SkMathPriv.h", 49 "SkQuads.h", 50 "SkSafeMath.h", 51 "SkSharedMutex.h", 52 "SkSpinlock.h", 53 "SkTSearch.h", 54 "SkTime.h", 55 "SkUTF.h", 56 "SkUtils.h", 57 "SkVx.h", # Causes IWYU to crash when compiling. 58 ], 59) 60 61# In a separate file group because these files are exported to sksl.gni:skslc_deps. 62skia_filegroup( 63 name = "skslc_srcs", 64 srcs = [ 65 "SkArenaAlloc.cpp", 66 "SkBlockAllocator.cpp", 67 "SkContainers.cpp", 68 "SkHalf.cpp", 69 "SkMalloc.cpp", 70 "SkMathPriv.cpp", 71 "SkSafeMath.cpp", 72 "SkSemaphore.cpp", 73 "SkThreadID.cpp", 74 "SkUTF.cpp", 75 "SkUtils.cpp", 76 ], 77) 78 79skia_filegroup( 80 name = "srcs", 81 srcs = [ 82 "SkBase64.cpp", 83 "SkBezierCurves.cpp", 84 "SkBuffer.cpp", 85 "SkCubics.cpp", 86 "SkDebug.cpp", 87 "SkDeque.cpp", 88 "SkFloatingPoint.cpp", 89 "SkQuads.cpp", 90 "SkSharedMutex.cpp", 91 "SkSpinlock.cpp", 92 "SkTDArray.cpp", 93 "SkTSearch.cpp", 94 "SkTime.cpp", 95 ":skslc_srcs", 96 ], 97) 98 99skia_cc_library( 100 name = "base", 101 srcs = [ 102 ":srcs", 103 "//src/ports:base_srcs", 104 ], 105 hdrs = [ 106 ":private_hdrs", 107 "//include/private/base:private_hdrs", 108 ], 109 features = ["layering_check"], 110 visibility = [ 111 "//bench:__subpackages__", 112 "//experimental/rust_png:__subpackages__", 113 "//modules:__subpackages__", 114 "//src:__subpackages__", 115 "//tests:__subpackages__", 116 "//tools:__subpackages__", 117 ], 118 deps = ["@skia_user_config//:user_config"], 119) 120 121generate_cpp_files_for_headers( 122 name = "headers_to_compile", 123 headers = IWYU_HDRS, 124) 125