| 1 |
load("@skia_user_config//:copts.bzl", "DEFAULT_OBJC_COPTS") |
| 2 |
load("//bazel:skia_rules.bzl", "skia_objc_library", "split_srcs_and_hdrs") |
| 3 |
|
| 4 |
package( |
| 5 |
default_applicable_licenses = ["//:license"], |
| 6 |
) |
| 7 |
|
| 8 |
licenses(["notice"]) |
| 9 |
|
| 10 |
METAL_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 |
|
| 41 |
split_srcs_and_hdrs( |
| 42 |
name = "mtl", |
| 43 |
files = METAL_FILES, |
| 44 |
) |
| 45 |
|
| 46 |
skia_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 |
|
| 76 |
skia_objc_library( |
| 77 |
name = "graphite_native_metal_TEST_UTIL", |
| 78 |
testonly = True, |
| 79 |
srcs = [ |
| 80 |
":mtl_hdrs", |
| 81 |
":mtl_srcs", |
| 82 |
], |
| 83 |
hdrs = [ |
| 84 |
"//include/gpu:shared_gpu_hdrs", |
| 85 |
"//include/gpu/graphite:public_hdrs", |
| 86 |
"//include/gpu/graphite/mtl:public_hdrs", |
| 87 |
"//include/gpu/mtl:public_hdrs", |
| 88 |
"//include/ports:core_foundation_hdrs", |
| 89 |
], |
| 90 |
copts = DEFAULT_OBJC_COPTS + [ |
| 91 |
"-fno-objc-arc", |
| 92 |
"-DGPU_TEST_UTILS", |
| 93 |
], |
| 94 |
defines = ["SK_METAL"], |
| 95 |
sdk_frameworks = [ |
| 96 |
"Foundation", |
| 97 |
"Metal", |
| 98 |
], |
| 99 |
visibility = ["//tools:__subpackages__"], |
| 100 |
deps = [ |
| 101 |
"//:core", |
| 102 |
"//src/base", |
| 103 |
"//src/core:core_priv", |
| 104 |
"//src/gpu", |
| 105 |
"//src/gpu/graphite:graphite_TEST_UTIL", |
| 106 |
"//src/gpu/mtl:gpu_mtl", |
| 107 |
], |
| 108 |
) |