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