Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23a4b178 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Reland "floss: Refactor build for bt_common tests"" am: 6bb1127a am: fbab2506

parents feed1cdd fbab2506
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,7 @@ static_library("libbluetooth_gd") {
  include_dirs = [ "." ]
  include_dirs = [ "." ]
  configs += [ ":gd_defaults" ]
  configs += [ ":gd_defaults" ]
  deps = [
  deps = [
    "//bt/system/gd/rust/common:libbt_keystore_cc",
    "//bt/system/gd/rust/topshim:libbluetooth_topshim",
    "//bt/system/gd/rust/topshim:libbluetooth_topshim",
    "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
    "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
    "//bt/system/gd:BluetoothGeneratedPackets_h",
    "//bt/system/gd:BluetoothGeneratedPackets_h",
+20 −17
Original line number Original line Diff line number Diff line
@@ -15,29 +15,32 @@


import("//common-mk/cxxbridge.gni")
import("//common-mk/cxxbridge.gni")


rust_library("libbt_common") {
static_library("libbt_keystore_cc") {
  crate_name = "bt_common"
  complete_static_lib = true
  sources = [ "keystore/fake_bt_keystore.cc" ]
  deps = [
    ":libbt_common_bridge_code"
  ]


  sources = [ "src/lib.rs" ]
  configs += ["//bt/system/gd:gd_defaults"]
}


  configs = [
config("rust_common_config") {
    "//bt/system/gd/rust/shim:rust_libs",
  include_dirs = [ "//bt/system/gd/rust/common" ]
    "//bt/system/gd:rust_defaults",
  ]
}
}


cxxbridge_cc("libbt_common_sys_prop_bridge_code") {
cxxbridge_header("libbt_common_bridge_header") {
  sources = [ "src/sys_prop.rs" ]
  sources = [ "src/bridge.rs" ]
  all_dependent_configs = [ ":rust_common_config" ]
  deps = [ ":cxxlibheader" ]
}


cxxbridge_cc("libbt_common_bridge_code") {
  sources = [ "src/bridge.rs" ]
  deps = [ ":libbt_common_bridge_header" ]
  configs = [ "//bt/system/gd:gd_defaults" ]
  configs = [ "//bt/system/gd:gd_defaults" ]
}
}


static_library("libbt_common_sys_prop_cxx") {
cxxbridge_libheader("cxxlibheader") {
  sources = [ "src/ffi/sys_props.cc" ]
  deps = []

  include_dirs = [ "src/ffi" ]

  deps = [ ":libbt_common_sys_prop_bridge_code" ]

  configs += [ "//bt/system/gd:gd_defaults" ]
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ edition = "2018"
[dependencies]
[dependencies]
cxx = "*"
cxx = "*"
env_logger = "*"
env_logger = "*"
futures = "0.3.13"
grpcio = "*"
grpcio = "*"
lazy_static = "*"
lazy_static = "*"
log = "*"
log = "*"
+12 −0
Original line number Original line Diff line number Diff line
fn main() {
    let target_dir = std::env::var_os("CARGO_TARGET_DIR").unwrap();

    // Link the keystore static lib and make sure to use -lc++
    println!("cargo:rustc-link-lib=static=bt_keystore_cc");
    println!("cargo:rustc-link-search=native={}", target_dir.clone().into_string().unwrap());
    println!("cargo:rustc-link-lib=c++");

    // Re-run if static libs or this file changed.
    println!("cargo:rerun-if-changed={}", target_dir.into_string().unwrap());
    println!("cargo:rerun-if-changed=build.rs");
}