diff options
author | Yecheng Zhao <zyecheng@google.com> | 2023-10-09 23:11:57 +0000 |
---|---|---|
committer | Yecheng Zhao <zyecheng@google.com> | 2023-10-09 23:11:57 +0000 |
commit | ed92e3395a5662c8cc764adb42be000e8799ccf4 (patch) | |
tree | 6465b0b4f732e2b574f503bd77b0e1f6c67988b5 | |
parent | 52af5a82bdbd76ec26f9256d0e06810de26ae66b (diff) | |
download | zerocopy-derive-ed92e3395a5662c8cc764adb42be000e8799ccf4.tar.gz |
Add BUILD file for zerocopy-derive kleaf build
Test:
touch external/rust/crates/unicode-ident/WORKSPACE && \
touch external/rust/crates/proc-macro2/WORKSPACE && \
touch external/rust/crates/quote/WORKSPACE && \
touch external/rust/crates/syn/WORKSPACE && \
touch external/rust/crates/zerocopy-derive/WORKSPACE && \
b build @zerocopy-derive \
--override_repository=unicode-ident=external/rust/crates/unicode-ident/ \
--override_repository=proc-macro2=external/rust/crates/proc-macro2/ \
--override_repository=quote=external/rust/crates/quote/ \
--override_repository=syn=external/rust/crates/syn/ \
--override_repository=zerocopy-derive=external/rust/crates/zerocopy-derive/
Bug: 304282799
Change-Id: I84385d5131b1e516626141587675b95167e7042e
-rw-r--r-- | BUILD | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -0,0 +1,46 @@ +load("@rules_license//rules:license.bzl", "license") +load("@rules_license//rules:license_kind.bzl", "license_kind") +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package( + default_applicable_licenses = [":license"], + default_visibility = ["//visibility:public"], +) + +license( + name = "license", + license_kinds = [ + ":SPDX-license-identifier-Apache-2.0", + ":SPDX-license-identifier-MIT", + ], + 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", +) + +license_kind( + name = "SPDX-license-identifier-MIT", + conditions = ["notice"], + url = "", +) + +rust_proc_macro( + name = "zerocopy-derive", + srcs = glob(["**/*.rs"]), + edition = "2018", + deps = [ + # This should map to repo checked out from Android third party project + # "platform/external/rust/crates/proc-macro2". Similar for the rest of the dependencies + # below. + "@proc-macro2", + # Map to project repo "platform/external/rust/crates/quote". + "@quote", + # Map to project repo "platform/external/rust/crates/syn". + "@syn", + ], +) |