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 17# This is the root build file for GN. GN will start processing by loading this 18# file, and recursively load all dependencies until all dependencies are either 19# resolved or known not to exist (which will cause the build to fail). So if 20# you add a new build file, there must be some path of dependencies from this 21# file to your new one or GN won't know about it. 22 23group("all") { 24 deps = [ ":bluetooth" ] 25 26 #if (use.test) { 27 #deps += [ ":bluetooth_tests" ] 28 #} 29} 30 31# This pulls in main/BUILD.gn and all of its dependencies. 32group("bluetooth") { 33 deps = [ 34 "//bt/system/main:bluetooth", 35 "//bt/system/main:bluetooth-static", 36 #"//bt/system/service:bluetoothtbd", 37 ] 38} 39 40# TODO(b/190750167) - Re-enable once we're fully Bazel build 41#if (use.test) { 42 #group("bluetooth_tests") { 43 #deps = [ 44 #"//bt/system/common:bluetooth_test_common", 45 #"//bt/system/profile/avrcp:net_test_avrcp", 46 #"//bt/system/service:bluetoothtbd_test", 47 #"//bt/system/stack:net_test_btm_iso", 48 #"//bt/system/types:net_test_types", 49 50 ##"//bt/system/packet:net_test_btpackets", 51 #] 52 #} 53#} 54 55group("tools") { 56 deps = [ 57 "//bt/system/gd/packet/parser:bluetooth_packetgen", 58 ] 59} 60 61if (defined(use.android) && use.android) { 62 group("android_bluetooth_tests") { 63 deps = [ 64 "//bt/system/device:net_test_device", 65 "//bt/system/device:net_test_device_iot_config", 66 "//bt/system/hci:net_test_hci", 67 "//bt/system/osi:net_test_osi", 68 "//bt/system/test/suite:net_test_bluetooth", 69 ] 70 } 71} 72 73config("target_defaults") { 74 include_dirs = [ 75 "//bt/system", 76 "//bt/flags/exported_include", 77 "//bt/sysprop/exported_include", 78 "//bt/system/include", 79 "//bt/system/gd", 80 "//bt/system/pdl/hci/include", 81 82 # For flatbuffer generated headers 83 "${root_gen_dir}/bt/system/gd/", 84 "${root_gen_dir}/bt/system/gd/dumpsys/bundler", 85 ] 86 87 cflags = [ 88 "-fPIC", 89 "-Wno-non-c-typedef-for-linkage", 90 "-Wno-unreachable-code-return", 91 "-Wno-defaulted-function-deleted", 92 "-Wno-gnu-variable-sized-type-not-at-end", 93 "-Wno-format-nonliteral", 94 "-Wno-inconsistent-missing-override", 95 "-Wno-unreachable-code", 96 "-Wno-range-loop-construct", 97 "-Wno-reorder-init-list", 98 "-Wno-unused-function", 99 "-Wno-unused-result", 100 "-Wno-unused-variable", 101 "-Wno-unused-const-variable", 102 "-Wno-format", 103 "-Wno-pessimizing-move", 104 "-Wno-unknown-warning-option", 105 "-Wno-final-dtor-non-final-class", 106 107 string_join("", 108 [ 109 "-ffile-prefix-map=", 110 rebase_path(".", "${root_build_dir}", "."), 111 "/= ", 112 ]), 113 ] 114 115 cflags_cc = [ "-std=c++20" ] 116 117 defines = [ 118 "TARGET_FLOSS", 119 "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))", 120 "FALLTHROUGH_INTENDED=[[clang::fallthrough]]", 121 ] 122 123 if (!(defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs)) { 124 defines += [ "EXCLUDE_NONSTANDARD_CODECS" ] 125 } 126 127 configs = [ ":external_libchrome" ] 128 129 if (target_os == "chromeos") { 130 configs += [ ":external_chromeos" ] 131 } 132} 133 134group("libbt-platform-protos-lite") { 135 deps = [ 136 "//external/proto_logging/stats/enums/bluetooth:libbt-platform-protos-lite", 137 ] 138} 139 140# Configurations to use as dependencies for GN build 141config("external_gtest") { 142 configs = [ 143 ":pkg_gtest", 144 ":pkg_gmock", 145 ] 146} 147 148config("external_gtest_main") { 149 configs = [ ":pkg_gtest_main" ] 150} 151 152config("external_gmock_main") { 153 configs = [ ":pkg_gmock_main" ] 154} 155 156config("external_libchrome") { 157 configs = [ ":pkg_libchrome" ] 158} 159 160config("external_modp_b64") { 161 configs = [ ":pkg_modp_b64" ] 162} 163 164config("external_tinyxml2") { 165 configs = [ ":pkg_tinyxml2" ] 166} 167 168config("external_flatbuffers") { 169 lib_dirs = [ "${libdir}" ] 170 171 libs = [ "flatbuffers" ] 172} 173 174config("external_fmtlib") { 175 configs = [ ":pkg_fmtlib" ] 176} 177 178# Package configurations to extract dependencies from env 179pkg_config("pkg_gtest") { 180 pkg_deps = [ "gtest" ] 181} 182 183pkg_config("pkg_gtest_main") { 184 pkg_deps = [ "gtest_main" ] 185} 186 187pkg_config("pkg_gmock") { 188 pkg_deps = [ "gmock" ] 189} 190 191pkg_config("pkg_gmock_main") { 192 pkg_deps = [ "gmock_main" ] 193} 194 195pkg_config("pkg_libchrome") { 196 pkg_deps = [ "libchrome" ] 197} 198 199pkg_config("pkg_modp_b64") { 200 pkg_deps = [ "libmodp_b64" ] 201} 202 203pkg_config("pkg_tinyxml2") { 204 pkg_deps = [ "tinyxml2" ] 205} 206 207pkg_config("pkd_fmtlib") { 208 pkg_deps = [ "fmt" ] 209} 210 211# To include ChroemOS-specific libraries and build dependencies. 212if (target_os == "chromeos") { 213 config("external_chromeos") { 214 configs = [ ":pkgpkg_libstructuredmetrics" ] 215 } 216 217 pkg_config("pkgpkg_libstructuredmetrics") { 218 pkg_deps = [ "libstructuredmetrics" ] 219 } 220} 221