1# Copyright 2024 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15import("//build_overrides/pigweed.gni") 16import("$dir_pw_bloat/bloat.gni") 17import("$dir_pw_bluetooth_sapphire/sapphire.gni") 18import("$dir_pw_build/target_types.gni") 19 20config("getentropy_wrap_config") { 21 ldflags = [ "-Wl,--wrap=getentropy" ] 22 visibility = [ ":*" ] 23} 24 25pw_source_set("wrap_getentropy") { 26 all_dependent_configs = [ ":getentropy_wrap_config" ] 27 sources = [ "wrap_getentropy.cc" ] 28} 29 30pw_executable("host") { 31 sources = [ "host.cc" ] 32 deps = [ 33 ":wrap_getentropy", 34 "$dir_pw_bloat:bloat_this_binary", 35 "$dir_pw_bluetooth_sapphire/host", 36 ] 37} 38 39pw_executable("boringssl_base") { 40 sources = [ "boringssl_base.cc" ] 41 deps = [ 42 ":wrap_getentropy", 43 "$dir_pw_bloat:bloat_this_binary", 44 "$dir_pw_third_party/boringssl", 45 ] 46} 47 48# We can only compute size when Sapphire is enabled, implying that all the 49# necessary GN args and dependencies (e.g. emboss, boringssl) are configured. 50if (pw_bluetooth_sapphire_ENABLED) { 51 pw_size_diff("host_size_diff") { 52 title = "Host Size Report" 53 binaries = [ 54 { 55 target = ":host" 56 base = "$dir_pw_bloat:bloat_base" 57 label = "Create and initialize host" 58 }, 59 { 60 target = ":boringssl_base" 61 base = "$dir_pw_bloat:bloat_base" 62 label = "BoringSSL" 63 }, 64 { 65 target = ":host" 66 base = ":boringssl_base" 67 label = "Create and initialize host (minus BoringSSL)" 68 }, 69 ] 70 } 71} else { 72 pw_size_diff("host_size_diff") { 73 title = "Host Size Report" 74 base = "$dir_pw_bloat:bloat_base" 75 binaries = [ 76 { 77 target = "$dir_pw_bloat:bloat_base" 78 label = "Packages not configured" 79 }, 80 ] 81 } 82} 83