blob: ee1a17f33a9b389de225c0edc3bf2712ce545995 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components.gni")
import("//build/rust/rustc_macro.gni")
import("//build/rust/rustc_test.gni")
rustc_macro("zerocopy-derive") {
version = "0.1.0"
edition = "2021"
with_unit_tests = true
deps = [
"//third_party/rust_crates:proc-macro2",
"//third_party/rust_crates:quote",
"//third_party/rust_crates:syn",
]
sources = [
"src/ext.rs",
"src/lib.rs",
"src/repr.rs",
"tests/enum_as_bytes.rs",
"tests/enum_from_bytes.rs",
"tests/enum_unaligned.rs",
"tests/hygiene.rs",
"tests/paths_and_modules.rs",
"tests/struct_as_bytes.rs",
"tests/struct_from_bytes.rs",
"tests/struct_unaligned.rs",
"tests/union_as_bytes.rs",
"tests/union_from_bytes.rs",
"tests/union_unaligned.rs",
# "tests/compiletest.rs" is intentionally omitted since it needs to be able
# to invoke rustc and there's currently no way for test code to allow
# invoking the compiler from GN.
]
}
group("tests") {
testonly = true
public_deps = [ ":zerocopy-derive_test" ]
}