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