1# 2# Copyright 2015 Google, Inc. 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 17config("libbluetooth_config") { 18 include_dirs = [ "../include" ] 19} 20 21# Complete static library for linking with Rust 22static_library("bluetooth-static") { 23 complete_static_lib = true 24 25 sources = [ 26 ] 27 28 configs += [ 29 "//bt/system:target_defaults" 30 ] 31 32 deps = [ 33 ":bluetooth", 34 ] 35} 36 37# Configure libbluetooth as either dynamic or static library 38if (defined(use.bt_dynlib) && use.bt_dynlib) { 39 lib_type = "shared_library" 40} else { 41 lib_type = "static_library" 42} 43 44target(lib_type, "bluetooth") { 45 46 # Platform specific 47 sources = [ 48 "bte_conf.cc", 49 "stack_config.cc", 50 ] 51 52 public_configs = [ ":libbluetooth_config" ] 53 54 include_dirs = [ 55 "//bt/system/", 56 "//bt/system/bta/include", 57 "//bt/system/bta/sys", 58 "//bt/system/bta/dm", 59 "//bt/system/stack/include", 60 "//bt/system/stack/l2cap", 61 "//bt/system/stack/a2dp", 62 "//bt/system/stack/btm", 63 "//bt/system/stack/avdt", 64 "//bt/system/hci", 65 "//bt/system/udrv/include", 66 "//bt/system/btif/include", 67 "//bt/system/btif/co", 68 "//bt/system/vnd/include", 69 "//bt/system/brcm/include", 70 "//bt/system/embdrv/sbc/encoder/include", 71 "//bt/system/embdrv/sbc/decoder/include", 72 "//bt/system/test/suite", 73 ] 74 75 deps = [ 76 "//bt/system/audio_hal_interface", 77 "//bt/system/bta", 78 "//bt/system/btcore", 79 "//bt/system/btif", 80 "//bt/system/device", 81 "//bt/system/embdrv/g722", 82 "//bt/system/embdrv/sbc", 83 "//bt/system/gd:libbluetooth_gd", 84 "//bt/system/log:libbluetooth_log", 85 "//bt/system/hci", 86 "//bt/system/main/shim:BluetoothStackManagerSources", 87 "//bt/system/main/shim:LibBluetoothShimSources", 88 "//bt/system/osi", 89 "//bt/system/packet", 90 "//bt/system/rust:core_rs", 91 "//bt/system/stack", 92 "//bt/system/udrv", 93 ] 94 95 configs += [ 96 "//bt/system:target_defaults", 97 "//bt/system/log:log_defaults", 98 "//bt/system:external_tinyxml2", 99 "//bt/system:external_flatbuffers", 100 ] 101 102 cflags_c = [ 103 "-Lobj/osi", 104 "-losi", 105 ] 106 107 libs = [ 108 "dl", 109 "fmt", 110 "pthread", 111 "resolv", 112 "rt", 113 "z", 114 ] 115 116 lib_dirs = [ "${root_out_dir}/rust" ] 117} 118