Skip to content

Commit e695da4

Browse files
committed
floss: have floss built with libstructuredmetrics
Update the Floss build process to utilize the new GN flag target_os and environmental variable TARGET_OS_VARIENT to include libstructuredmetrics when building for ChromeOS. Correct GN syntaxes. BUG: 232098615 Tag: #floss Test: ./build.py --target test Test: emerge-${BOARD} floss Change-Id: I0bf960751643f12f7e1ef03c7aa844d112fbb5d5
1 parent 43f85a7 commit e695da4

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ group("all") {
2525
}
2626

2727
# Tools should be built for the host target.
28-
if (host_cpu == target_cpu && host_os == target_os) {
28+
if (target_os == "linux") {
2929
group("tools") {
3030
deps = [ "//bt/system:tools" ]
3131
}

system/BUILD.gn

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,15 @@ config("target_defaults") {
103103
"-Wno-unknown-warning-option",
104104
"-Wno-final-dtor-non-final-class",
105105

106-
string_join("", ["-ffile-prefix-map=", rebase_path(".", "${root_build_dir}", "."), "/= "])
106+
string_join("",
107+
[
108+
"-ffile-prefix-map=",
109+
rebase_path(".", "${root_build_dir}", "."),
110+
"/= ",
111+
]),
107112
]
108113

109-
cflags_cc = [
110-
"-std=c++17",
111-
]
114+
cflags_cc = [ "-std=c++17" ]
112115

113116
defines = [
114117
"HAS_NO_BDROID_BUILDCFG",
@@ -117,14 +120,18 @@ config("target_defaults") {
117120
"TARGET_FLOSS",
118121
"EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
119122
"FALLTHROUGH_INTENDED=[[clang::fallthrough]]",
120-
"BTIF_HF_FEATURES=0x00000640"
123+
"BTIF_HF_FEATURES=0x00000640",
121124
]
122125

123126
if (!(defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs)) {
124127
defines += [ "EXCLUDE_NONSTANDARD_CODECS" ]
125128
}
126129

127130
configs = [ ":external_libchrome" ]
131+
132+
if (target_os == "chromeos") {
133+
configs += [ ":external_chromeos" ]
134+
}
128135
}
129136

130137
group("libbt-platform-protos-lite") {
@@ -223,3 +230,14 @@ if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) {
223230
pkg_deps = [ "ldacBT-abr" ]
224231
}
225232
}
233+
234+
# To include ChroemOS-specific libraries and build dependencies.
235+
if (target_os == "chromeos") {
236+
config("external_chromeos") {
237+
configs = [ ":pkgpkg_libstructuredmetrics" ]
238+
}
239+
240+
pkg_config("pkgpkg_libstructuredmetrics") {
241+
pkg_deps = [ "libstructuredmetrics" ]
242+
}
243+
}

system/gd/rust/linux/service/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ fn main() {
2626
Config::new().probe("libmodp_b64").unwrap();
2727
Config::new().probe("tinyxml2").unwrap();
2828

29+
// Include ChromeOS-specific dependencies.
30+
if option_env!("TARGET_OS_VARIANT").unwrap_or("None").to_string() == "chromeos" {
31+
Config::new().probe("libstructuredmetrics").unwrap();
32+
}
33+
2934
println!("cargo:rerun-if-changed=build.rs");
3035
}

0 commit comments

Comments
 (0)