diff options
-rw-r--r-- | BUILD.gn | 2 | ||||
-rw-r--r-- | system/BUILD.gn | 28 | ||||
-rw-r--r-- | system/gd/rust/linux/service/build.rs | 5 |
3 files changed, 29 insertions, 6 deletions
@@ -25,7 +25,7 @@ group("all") { } # Tools should be built for the host target. -if (host_cpu == target_cpu && host_os == target_os) { +if (target_os == "linux") { group("tools") { deps = [ "//bt/system:tools" ] } diff --git a/system/BUILD.gn b/system/BUILD.gn index d8517dd9a6..379cff0f05 100644 --- a/system/BUILD.gn +++ b/system/BUILD.gn @@ -103,12 +103,15 @@ config("target_defaults") { "-Wno-unknown-warning-option", "-Wno-final-dtor-non-final-class", - string_join("", ["-ffile-prefix-map=", rebase_path(".", "${root_build_dir}", "."), "/= "]) + string_join("", + [ + "-ffile-prefix-map=", + rebase_path(".", "${root_build_dir}", "."), + "/= ", + ]), ] - cflags_cc = [ - "-std=c++17", - ] + cflags_cc = [ "-std=c++17" ] defines = [ "HAS_NO_BDROID_BUILDCFG", @@ -117,7 +120,7 @@ config("target_defaults") { "TARGET_FLOSS", "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))", "FALLTHROUGH_INTENDED=[[clang::fallthrough]]", - "BTIF_HF_FEATURES=0x00000640" + "BTIF_HF_FEATURES=0x00000640", ] if (!(defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs)) { @@ -125,6 +128,10 @@ config("target_defaults") { } configs = [ ":external_libchrome" ] + + if (target_os == "chromeos") { + configs += [ ":external_chromeos" ] + } } group("libbt-platform-protos-lite") { @@ -223,3 +230,14 @@ if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) { pkg_deps = [ "ldacBT-abr" ] } } + +# To include ChroemOS-specific libraries and build dependencies. +if (target_os == "chromeos") { + config("external_chromeos") { + configs = [ ":pkgpkg_libstructuredmetrics" ] + } + + pkg_config("pkgpkg_libstructuredmetrics") { + pkg_deps = [ "libstructuredmetrics" ] + } +} diff --git a/system/gd/rust/linux/service/build.rs b/system/gd/rust/linux/service/build.rs index 1c499f49ae..d92e5b703f 100644 --- a/system/gd/rust/linux/service/build.rs +++ b/system/gd/rust/linux/service/build.rs @@ -26,5 +26,10 @@ fn main() { Config::new().probe("libmodp_b64").unwrap(); Config::new().probe("tinyxml2").unwrap(); + // Include ChromeOS-specific dependencies. + if option_env!("TARGET_OS_VARIANT").unwrap_or("None").to_string() == "chromeos" { + Config::new().probe("libstructuredmetrics").unwrap(); + } + println!("cargo:rerun-if-changed=build.rs"); } |