1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
load("@rules_license//rules:license.bzl", "license")
load("@rules_license//rules:license_kind.bzl", "license_kind")
load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
load("@rules_rust//rust:defs.bzl", "rust_shared_library")
package(
default_applicable_licenses = [":license"],
default_visibility = ["//visibility:public"],
)
license(
name = "license",
license_kinds = [
":SPDX-license-identifier-Apache-2.0",
],
license_text = "LICENSE-APACHE",
visibility = [":__subpackages__"],
)
license_kind(
name = "SPDX-license-identifier-Apache-2.0",
conditions = ["notice"],
url = "https://spdx.org/licenses/Apache-2.0.html",
)
CRATE_FEATURES = [
"rutabaga_gfx/gfxstream",
]
rust_shared_library(
name = "rutabaga_ffi",
srcs = glob(["src/**/*.rs"]),
crate_features = CRATE_FEATURES,
edition = "2021",
deps = [
"//external/crosvm/rutabaga_gfx",
"//hardware/google/gfxstream/host:gfxstream_backend",
"@libc",
"@log",
"@once_cell",
] + select({
"@platforms//os:linux": ["@nix"],
"//conditions:default": [],
}),
)
cc_library(
name = "c_ffi",
hdrs = glob(["src/include/**/*.h"]),
includes = ["src/include"],
linkopts = select({
"@platforms//os:windows": ["/DEFAULTLIB:Ntdll.lib"],
"//conditions:default": [],
}),
deps = [":rutabaga_ffi"],
)
cargo_build_script(
name = "ffi_build_script",
srcs = glob(["**/*.rs"]),
crate_features = CRATE_FEATURES,
crate_root = "build.rs",
edition = "2015",
visibility = ["//visibility:private"],
)
|