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 "//bt/service/hal/bluetooth_interface.cc", 27 "//bt/service/logging_helpers.cc", 28 ] 29 30 configs += [ 31 "//bt:target_defaults" 32 ] 33 34 deps = [ 35 ":bluetooth", 36 ] 37} 38 39# Configure libbluetooth as either dynamic or static library 40if (defined(use.bt_dynlib) && use.bt_dynlib) { 41 lib_type = "shared_library" 42} else { 43 lib_type = "static_library" 44} 45 46target(lib_type, "bluetooth") { 47 48 # Platform specific 49 sources = [ 50 "bte_conf.cc", 51 "bte_init_cpp_logging.cc", 52 "bte_logmsg.cc", 53 "bte_main.cc", 54 "stack_config.cc", 55 ] 56 57 public_configs = [ ":libbluetooth_config" ] 58 59 include_dirs = [ 60 "//bt/", 61 "//bt/bta/include", 62 "//bt/bta/sys", 63 "//bt/bta/dm", 64 "//bt/btcore/include", 65 "//bt/internal_include", 66 "//bt/stack/include", 67 "//bt/stack/l2cap", 68 "//bt/stack/a2dp", 69 "//bt/stack/btm", 70 "//bt/stack/avdt", 71 "//bt/hci", 72 "//bt/hci/include", 73 "//bt/udrv/include", 74 "//bt/btif/include", 75 "//bt/btif/co", 76 "//bt/hci/includ", 77 "//bt/vnd/include", 78 "//bt/brcm/include", 79 "//bt/embdrv/sbc/encoder/include", 80 "//bt/embdrv/sbc/decoder/include", 81 "//bt/utils/include", 82 "//bt/test/suite", 83 ] 84 85 deps = [ 86 "//bt/audio_hal_interface", 87 "//bt/bta", 88 "//bt/btcore", 89 "//bt/btif", 90 "//bt/device", 91 "//bt/embdrv/g722", 92 "//bt/embdrv/sbc", 93 "//bt/gd:libbluetooth_gd", 94 "//bt/hci", 95 "//bt/main/shim:LibBluetoothShimSources", 96 "//bt/osi", 97 "//bt/packet", 98 "//bt/stack", 99 "//bt/udrv", 100 "//bt/utils", 101 ] 102 103 configs += [ 104 "//bt:target_defaults", 105 "//bt:external_tinyxml2", 106 "//bt:external_flatbuffers", 107 ] 108 109 cflags_c = [ 110 "-Lobj/osi", 111 "-losi", 112 ] 113 114 libs = [ 115 "dl", 116 "pthread", 117 "resolv", 118 "rt", 119 "z", 120 "bt_shim_ffi", 121 ] 122 123 lib_dirs = [ "${root_out_dir}/rust" ] 124} 125