1# 2# Copyright 2020 Google 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at: 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17import("//common-mk/cxxbridge.gni") 18 19config("rust_shim_config") { 20 include_dirs = [ "//bt/gd/rust/shim" ] 21} 22 23cxxbridge_header("shim_bridge_header") { 24 sources = [ "src/bridge.rs" ] 25 all_dependent_configs = [ ":rust_shim_config" ] 26 deps = [ ":cxxlibheader" ] 27} 28 29cxxbridge_cc("shim_bridge_code") { 30 sources = [ "src/bridge.rs" ] 31 deps = [ ":shim_bridge_header" ] 32 configs = [ "//bt/gd:gd_defaults" ] 33} 34 35cxxbridge_header("init_flags_bridge_header") { 36 sources = [ "src/init_flags.rs" ] 37 all_dependent_configs = [ ":rust_shim_config" ] 38 deps = [ ":cxxlibheader" ] 39} 40 41cxxbridge_cc("init_flags_bridge_code") { 42 sources = [ "src/init_flags.rs" ] 43 deps = [ ":init_flags_bridge_header" ] 44 configs = [ "//bt/gd:gd_defaults" ] 45} 46 47cxxbridge_header("message_loop_thread_bridge_header") { 48 sources = [ "src/message_loop_thread.rs" ] 49 all_dependent_configs = [ ":rust_shim_config" ] 50 deps = [ ":cxxlibheader" ] 51} 52 53cxxbridge_cc("message_loop_thread_bridge_code") { 54 sources = [ "src/message_loop_thread.rs" ] 55 deps = [ ":message_loop_thread_bridge_header" ] 56 configs = [ "//bt/gd:gd_defaults" ] 57} 58 59cxxbridge_libheader("cxxlibheader") { 60 deps = [] 61} 62 63static_library("libbluetooth_rust_interop") { 64 deps = [ 65 ":cxxlibheader", 66 ":init_flags_bridge_code", 67 ":message_loop_thread_bridge_code", 68 ":shim_bridge_code", 69 ] 70} 71