| 1 |
load("@skia_user_config//:copts.bzl", "DEFAULT_OBJC_COPTS") |
| 2 |
load("//bazel:skia_rules.bzl", "skia_filegroup", "skia_objc_library", "split_srcs_and_hdrs") |
| 3 |
|
| 4 |
package( |
| 5 |
default_applicable_licenses = ["//:license"], |
| 6 |
) |
| 7 |
|
| 8 |
licenses(["notice"]) |
| 9 |
|
| 10 |
# A list of files that is included by C++ files, but whose |
| 11 |
# implementation resides in .mm files. The latter may need to |
| 12 |
# be compiled separately (e.g. with Automatic Reference Counting [ARC]). |
| 13 |
skia_filegroup( |
| 14 |
name = "mtl_cpp_hdrs", |
| 15 |
srcs = [ |
| 16 |
"GrMtlCppUtil.h", |
| 17 |
"GrMtlTrampoline.h", |
| 18 |
], |
| 19 |
) |
| 20 |
|
| 21 |
MTL_FILES = [ |
| 22 |
"GrMtlAttachment.h", |
| 23 |
"GrMtlAttachment.mm", |
| 24 |
"GrMtlBackendSemaphore.mm", |
| 25 |
"GrMtlBackendSurface.mm", |
| 26 |
"GrMtlBuffer.h", |
| 27 |
"GrMtlBuffer.mm", |
| 28 |
"GrMtlCaps.h", |
| 29 |
"GrMtlCaps.mm", |
| 30 |
"GrMtlCommandBuffer.h", |
| 31 |
"GrMtlCommandBuffer.mm", |
| 32 |
"GrMtlDepthStencil.h", |
| 33 |
"GrMtlDepthStencil.mm", |
| 34 |
"GrMtlDirectContext.mm", |
| 35 |
"GrMtlFramebuffer.h", |
| 36 |
"GrMtlFramebuffer.mm", |
| 37 |
"GrMtlGpu.h", |
| 38 |
"GrMtlGpu.mm", |
| 39 |
"GrMtlOpsRenderPass.h", |
| 40 |
"GrMtlOpsRenderPass.mm", |
| 41 |
"GrMtlPipeline.h", |
| 42 |
"GrMtlPipelineState.h", |
| 43 |
"GrMtlPipelineState.mm", |
| 44 |
"GrMtlPipelineStateBuilder.h", |
| 45 |
"GrMtlPipelineStateBuilder.mm", |
| 46 |
"GrMtlPipelineStateDataManager.h", |
| 47 |
"GrMtlPipelineStateDataManager.mm", |
| 48 |
"GrMtlRenderCommandEncoder.h", |
| 49 |
"GrMtlRenderTarget.h", |
| 50 |
"GrMtlRenderTarget.mm", |
| 51 |
"GrMtlResourceProvider.h", |
| 52 |
"GrMtlResourceProvider.mm", |
| 53 |
"GrMtlSampler.h", |
| 54 |
"GrMtlSampler.mm", |
| 55 |
"GrMtlSemaphore.h", |
| 56 |
"GrMtlSemaphore.mm", |
| 57 |
"GrMtlTexture.h", |
| 58 |
"GrMtlTexture.mm", |
| 59 |
"GrMtlTextureRenderTarget.h", |
| 60 |
"GrMtlTextureRenderTarget.mm", |
| 61 |
"GrMtlTrampoline.mm", |
| 62 |
"GrMtlTypesPriv.h", |
| 63 |
"GrMtlTypesPriv.mm", |
| 64 |
"GrMtlUniformHandler.h", |
| 65 |
"GrMtlUniformHandler.mm", |
| 66 |
"GrMtlUtil.h", |
| 67 |
"GrMtlUtil.mm", |
| 68 |
"GrMtlVaryingHandler.h", |
| 69 |
"GrMtlVaryingHandler.mm", |
| 70 |
] |
| 71 |
|
| 72 |
split_srcs_and_hdrs( |
| 73 |
name = "mtl", |
| 74 |
files = MTL_FILES, |
| 75 |
) |
| 76 |
|
| 77 |
skia_objc_library( |
| 78 |
name = "ganesh_metal", |
| 79 |
srcs = [ |
| 80 |
":mtl_cpp_hdrs", |
| 81 |
":mtl_hdrs", |
| 82 |
":mtl_srcs", |
| 83 |
"//src/gpu/ganesh/surface:mtl_objc_srcs", |
| 84 |
], |
| 85 |
hdrs = [ |
| 86 |
"//include/gpu:shared_gpu_hdrs", |
| 87 |
"//include/gpu/ganesh:ganesh_hdrs", |
| 88 |
"//include/gpu/ganesh/mtl:public_hdrs", |
| 89 |
"//include/gpu/mtl:public_hdrs", |
| 90 |
"//include/ports:core_foundation_hdrs", |
| 91 |
], |
| 92 |
copts = DEFAULT_OBJC_COPTS + ["-fobjc-arc"], |
| 93 |
defines = ["SK_METAL"], |
| 94 |
sdk_frameworks = [ |
| 95 |
"Metal", |
| 96 |
"MetalKit", |
| 97 |
"Foundation", |
| 98 |
], |
| 99 |
visibility = ["//:__pkg__"], |
| 100 |
deps = [ |
| 101 |
"//:core", |
| 102 |
"//src/base", |
| 103 |
"//src/core:core_priv", |
| 104 |
"//src/gpu", |
| 105 |
"//src/gpu/ganesh", |
| 106 |
"//src/gpu/mtl:gpu_mtl", |
| 107 |
"//src/sksl/codegen:metal", |
| 108 |
], |
| 109 |
) |
| 110 |
|
| 111 |
skia_objc_library( |
| 112 |
name = "ganesh_metal_TEST_UTIL", |
| 113 |
testonly = True, |
| 114 |
srcs = [ |
| 115 |
":mtl_cpp_hdrs", |
| 116 |
":mtl_hdrs", |
| 117 |
":mtl_srcs", |
| 118 |
"//src/gpu/ganesh/surface:mtl_objc_srcs", |
| 119 |
], |
| 120 |
hdrs = [ |
| 121 |
"//include/gpu:shared_gpu_hdrs", |
| 122 |
"//include/gpu/ganesh:ganesh_hdrs", |
| 123 |
"//include/gpu/ganesh/mtl:public_hdrs", |
| 124 |
"//include/gpu/mtl:public_hdrs", |
| 125 |
"//include/ports:core_foundation_hdrs", |
| 126 |
], |
| 127 |
copts = ["-fobjc-arc"], |
| 128 |
defines = ["SK_METAL"], |
| 129 |
sdk_frameworks = [ |
| 130 |
"Metal", |
| 131 |
"MetalKit", |
| 132 |
"Foundation", |
| 133 |
], |
| 134 |
visibility = ["//tools/window:__pkg__"], |
| 135 |
deps = [ |
| 136 |
"//:core", |
| 137 |
"//src/base", |
| 138 |
"//src/core:core_priv", |
| 139 |
"//src/gpu", |
| 140 |
"//src/gpu/ganesh:ganesh_TEST_UTIL", |
| 141 |
"//src/gpu/mtl:gpu_mtl", |
| 142 |
"//src/sksl/codegen:metal", |
| 143 |
], |
| 144 |
) |