blob: 0947b96c43dd6f1afeba4d41824302c0309dee65 [file]
load("@rules_rust//rust:defs.bzl", "rust_static_library")
load("//bazel:rust_cxx_bridge.bzl", "rust_cxx_bridge")
load(
"//bazel:skia_rules.bzl",
"skia_cc_library",
"skia_filegroup",
)
package(
default_applicable_licenses = ["//:license"],
)
licenses(["notice"])
skia_filegroup(
name = "rs_srcs",
srcs = ["FFI.rs"],
)
skia_filegroup(
name = "cxx_bridge_srcs",
srcs = ["FFI.rs"],
)
# Note: the `hdrs` of the `utils` target are included in *two* `.gni` lists
# (`skia_codec_rust_png` and `skia_encode_rust_png_srcs`) - this works only
# because this is a header-only library. If `utils` needs `srcs` in the
# future, then a separate `.gni` list may be required.
skia_cc_library(
name = "utils",
hdrs = ["UtilsForFFI.h"],
features = ["layering_check"],
visibility = [
"//src/codec:__pkg__",
"//src/encode:__pkg__",
],
deps = ["//:core"],
)
skia_cc_library(
name = "ffi_cpp",
hdrs = ["FFI.h"],
features = ["layering_check"],
visibility = [
"//src/codec:__pkg__",
"//src/encode:__pkg__",
],
)
rust_cxx_bridge(
name = "cxx_bridge",
src = "FFI.rs",
visibility = [
"//src/codec:__pkg__",
"//src/encode:__pkg__",
],
deps = [":ffi_cpp"],
)
rust_static_library(
name = "ffi_rs",
srcs = [":rs_srcs"],
rustc_flags = ["-Dwarnings"],
visibility = [
"//src/codec:__pkg__",
"//src/encode:__pkg__",
],
deps = [
":ffi_cpp",
"@crates//:cxx",
"@crates//:png",
],
)