• 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    "MtlGraphiteTypes.mm",
26    "MtlGraphiteUtils.mm",
27    "MtlGraphiteUtilsPriv.h",
28    "MtlQueueManager.h",
29    "MtlQueueManager.mm",
30    "MtlRenderCommandEncoder.h",
31    "MtlResourceProvider.h",
32    "MtlResourceProvider.mm",
33    "MtlSampler.h",
34    "MtlSampler.mm",
35    "MtlSharedContext.h",
36    "MtlSharedContext.mm",
37    "MtlTexture.h",
38    "MtlTexture.mm",
39    "MtlTextureInfo.mm",
40]
41
42split_srcs_and_hdrs(
43    name = "mtl",
44    files = METAL_FILES,
45)
46
47skia_objc_library(
48    name = "graphite_native_metal",
49    srcs = [
50        ":mtl_hdrs",
51        ":mtl_srcs",
52    ],
53    hdrs = [
54        "//include/gpu:shared_gpu_hdrs",
55        "//include/gpu/graphite:public_hdrs",
56        "//include/gpu/graphite/mtl:public_hdrs",
57        "//include/gpu/mtl:public_hdrs",
58        "//include/ports:core_foundation_hdrs",
59    ],
60    copts = DEFAULT_OBJC_COPTS + ["-fno-objc-arc"],
61    defines = ["SK_METAL"],
62    sdk_frameworks = [
63        "Foundation",
64        "Metal",
65    ],
66    visibility = ["//:__pkg__"],
67    deps = [
68        "//:core",
69        "//src/base",
70        "//src/core:core_priv",
71        "//src/gpu",
72        "//src/gpu/graphite",
73        "//src/gpu/mtl:gpu_mtl",
74    ],
75)
76