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/system/service/hal/bluetooth_interface.cc", 27 "//bt/system/service/logging_helpers.cc", 28 ] 29 30 configs += [ 31 "//bt/system: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/system/", 61 "//bt/system/bta/include", 62 "//bt/system/bta/sys", 63 "//bt/system/bta/dm", 64 "//bt/system/internal_include", 65 "//bt/system/stack/include", 66 "//bt/system/stack/l2cap", 67 "//bt/system/stack/a2dp", 68 "//bt/system/stack/btm", 69 "//bt/system/stack/avdt", 70 "//bt/system/hci", 71 "//bt/system/udrv/include", 72 "//bt/system/btif/include", 73 "//bt/system/btif/co", 74 "//bt/system/hci/includ", 75 "//bt/system/vnd/include", 76 "//bt/system/brcm/include", 77 "//bt/system/embdrv/sbc/encoder/include", 78 "//bt/system/embdrv/sbc/decoder/include", 79 "//bt/system/utils/include", 80 "//bt/system/test/suite", 81 ] 82 83 deps = [ 84 "//bt/system/audio_hal_interface", 85 "//bt/system/bta", 86 "//bt/system/btcore", 87 "//bt/system/btif", 88 "//bt/system/device", 89 "//bt/system/embdrv/g722", 90 "//bt/system/embdrv/sbc", 91 "//bt/system/gd:libbluetooth_gd", 92 "//bt/system/hci", 93 "//bt/system/main/shim:LibBluetoothShimSources", 94 "//bt/system/osi", 95 "//bt/system/packet", 96 "//bt/system/stack", 97 "//bt/system/udrv", 98 "//bt/system/utils", 99 ] 100 101 configs += [ 102 "//bt/system:target_defaults", 103 "//bt/system:external_tinyxml2", 104 "//bt/system:external_flatbuffers", 105 ] 106 107 cflags_c = [ 108 "-Lobj/osi", 109 "-losi", 110 ] 111 112 libs = [ 113 "dl", 114 "pthread", 115 "resolv", 116 "rt", 117 "z", 118 "bt_shim_ffi", 119 ] 120 121 lib_dirs = [ "${root_out_dir}/rust" ] 122} 123