xref: /aosp_15_r20/external/cronet/build/rust/rust_macro.gni (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1*6777b538SAndroid Build Coastguard Worker# Copyright 2022 The Chromium Authors
2*6777b538SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
3*6777b538SAndroid Build Coastguard Worker# found in the LICENSE file.
4*6777b538SAndroid Build Coastguard Worker
5*6777b538SAndroid Build Coastguard Workerimport("//build/config/rust.gni")
6*6777b538SAndroid Build Coastguard Workerimport("//build/rust/rust_target.gni")
7*6777b538SAndroid Build Coastguard Worker
8*6777b538SAndroid Build Coastguard Worker# Template for generating a Rust proc-macro library. Such targets produce a
9*6777b538SAndroid Build Coastguard Worker# dynamic library that is loaded during compilation and used to generate Rust
10*6777b538SAndroid Build Coastguard Worker# code for compilation.
11*6777b538SAndroid Build Coastguard Workertemplate("rust_macro") {
12*6777b538SAndroid Build Coastguard Worker  rust_target(target_name) {
13*6777b538SAndroid Build Coastguard Worker    forward_variables_from(invoker,
14*6777b538SAndroid Build Coastguard Worker                           "*",
15*6777b538SAndroid Build Coastguard Worker                           TESTONLY_AND_VISIBILITY + [ "configs" ])
16*6777b538SAndroid Build Coastguard Worker    forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
17*6777b538SAndroid Build Coastguard Worker    proc_macro_configs = invoker.configs
18*6777b538SAndroid Build Coastguard Worker    target_type = "rust_proc_macro"
19*6777b538SAndroid Build Coastguard Worker  }
20*6777b538SAndroid Build Coastguard Worker}
21*6777b538SAndroid Build Coastguard Worker
22*6777b538SAndroid Build Coastguard Workerset_defaults("rust_macro") {
23*6777b538SAndroid Build Coastguard Worker  configs = default_rust_proc_macro_configs
24*6777b538SAndroid Build Coastguard Worker}
25