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