• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@skia_user_config//:copts.bzl", "DEFAULT_OBJC_COPTS")
2load("//bazel:skia_rules.bzl", "skia_objc_library", "split_srcs_and_hdrs")
3
4package(
5    default_applicable_licenses = ["//:license"],
6)
7
8licenses(["notice"])
9
10METAL_FILES = [
11    "MtlBackendSemaphore.mm",
12    "MtlBackendTexture.mm",
13    "MtlBlitCommandEncoder.h",
14    "MtlBuffer.h",
15    "MtlBuffer.mm",
16    "MtlCaps.h",
17    "MtlCaps.mm",
18    "MtlCommandBuffer.h",
19    "MtlCommandBuffer.mm",
20    "MtlComputeCommandEncoder.h",
21    "MtlComputePipeline.h",
22    "MtlComputePipeline.mm",
23    "MtlGraphicsPipeline.h",
24    "MtlGraphicsPipeline.mm",
25    "MtlGraphiteUtils.mm",
26    "MtlGraphiteUtils.h",
27    "MtlQueueManager.h",
28    "MtlQueueManager.mm",
29    "MtlRenderCommandEncoder.h",
30    "MtlResourceProvider.h",
31    "MtlResourceProvider.mm",
32    "MtlSampler.h",
33    "MtlSampler.mm",
34    "MtlSharedContext.h",
35    "MtlSharedContext.mm",
36    "MtlTexture.h",
37    "MtlTexture.mm",
38    "MtlTextureInfo.mm",
39]
40
41split_srcs_and_hdrs(
42    name = "mtl",
43    files = METAL_FILES,
44)
45
46skia_objc_library(
47    name = "graphite_native_metal",
48    srcs = [
49        ":mtl_hdrs",
50        ":mtl_srcs",
51    ],
52    hdrs = [
53        "//include/gpu:shared_gpu_hdrs",
54        "//include/gpu/graphite:public_hdrs",
55        "//include/gpu/graphite/mtl:public_hdrs",
56        "//include/gpu/mtl:public_hdrs",
57        "//include/ports:core_foundation_hdrs",
58    ],
59    copts = DEFAULT_OBJC_COPTS + ["-fno-objc-arc"],
60    defines = ["SK_METAL"],
61    sdk_frameworks = [
62        "Foundation",
63        "Metal",
64    ],
65    visibility = ["//:__pkg__"],
66    deps = [
67        "//:core",
68        "//src/base",
69        "//src/core:core_priv",
70        "//src/gpu",
71        "//src/gpu/graphite",
72        "//src/gpu/mtl:gpu_mtl",
73    ],
74)
75