| load("@rules_rust//rust:defs.bzl", "rust_static_library") |
| load("//bazel:rust_cxx_bridge.bzl", "rust_cxx_bridge") |
| load( |
| "//bazel:skia_rules.bzl", |
| "exports_files_legacy", |
| "select_multi", |
| "skia_cc_library", |
| ) |
| |
| exports_files_legacy() |
| |
| # C++ sources |
| skia_cc_library( |
| name = "cpp", |
| hdrs = [ |
| "cpp/path_iterator.h", |
| ], |
| ) |
| |
| # Generated C++ cxxbridge output |
| rust_cxx_bridge( |
| name = "ffi_gen", |
| src = "src/lib.rs", |
| crate_features = select_multi( |
| { |
| "@vello//:msl_shaders": ["msl"], |
| "@vello//:wgsl_shaders": ["wgsl"], |
| }, |
| ), |
| deps = [":cpp"], |
| ) |
| |
| # Linked rust code |
| rust_static_library( |
| name = "vello_rust", |
| srcs = [ |
| "src/encoding.rs", |
| "src/lib.rs", |
| "src/shaders.rs", |
| ], |
| crate_features = select_multi( |
| { |
| "@vello//:msl_shaders": ["msl"], |
| "@vello//:wgsl_shaders": ["wgsl"], |
| }, |
| ), |
| deps = [ |
| "@cxx", |
| "@vello//:vello_encoding", |
| "@vello//:vello_shaders", |
| "@vello_deps//:bytemuck", |
| "@vello_deps//:peniko", |
| ], |
| ) |
| |
| # Linked C++ bridge code |
| cc_library( |
| name = "vello_ffi", |
| srcs = [":ffi_gen/filegroup"], |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":cpp", |
| ":ffi_gen/include", |
| ":vello_rust", |
| ], |
| ) |