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

Commit 865203c8 authored by David Duarte's avatar David Duarte Committed by Automerger Merge Worker
Browse files

Merge "Remove gd rust" into main am: ebca85b5

parents 041110aa ebca85b5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ LOCAL_cert_test_sources := \

LOCAL_host_executables := \
	$(HOST_OUT_EXECUTABLES)/bluetooth_stack_with_facade \
	$(HOST_OUT_EXECUTABLES)/bluetooth_with_facades \
	$(HOST_OUT_EXECUTABLES)/bt_topshim_facade \
	$(HOST_OUT_EXECUTABLES)/root-canal

+0 −1
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ static_library("libbluetooth_gd") {
  include_dirs = [ "." ]
  configs += [ ":gd_defaults" ]
  deps = [
    "//bt/system/gd/rust/common:libbt_keystore_cc",
    "//bt/system/gd/rust/topshim:libbluetooth_topshim",
    "//bt/system/gd/rust/shim:libbluetooth_rust_interop",
    "//bt/system/gd/att:BluetoothAttSources",
+0 −152
Original line number Diff line number Diff line
@@ -11,21 +11,13 @@ rust_library {
    name: "libbt_common",
    defaults: ["libbt_common_defaults"],
    rustlibs: [
        "libcxx",
        "libgrpcio",
        "liblazy_static",
        "liblog_rust",
        "libnix",
        "libtokio",
    ],
    target: {
        android: {
            rustlibs: [
                "libandroid_logger",
                "librustutils",
            ],
            shared_libs: [
                "libcutils",
            ],
        },
        host: {
@@ -34,33 +26,6 @@ rust_library {
            ],
        },
    },
    min_sdk_version: "Tiramisu",
}

rust_library {
    name: "libbt_common_only_init_flags",
    defaults: ["gd_rust_defaults"],
    crate_name: "bt_common",
    srcs: ["src/lib_only_init_flags.rs"],
    rustlibs: [
        "liblazy_static",
        "liblog_rust",
    ],
    target: {
        android: {
            rustlibs: [
                "libandroid_logger",
            ],
        },
        host: {
            rustlibs: [
                "libenv_logger",
            ],
        },
    },
    proc_macros: [
        "libpaste",
    ],
    apex_available: [
        "com.android.btservices",
    ],
@@ -73,124 +38,12 @@ rust_defaults {
    crate_name: "bt_common",
    srcs: ["src/lib.rs"],
    rustlibs: [
        "libbt_facade_helpers",
        "libbt_packets",
        "libcxx",
        "libenv_logger",
        "libfutures",
        "libgrpcio",
        "liblazy_static",
        "liblog_rust",
        "liblog_rust",
        "libnix",
        "libnix",
        "libnum_traits",
        "libtokio",
    ],
    proc_macros: [
        "libpaste",
    ],
    whole_static_libs: [
        "libbt_keystore_cc",
    ],
}

rust_ffi_static {
    name: "libbt_common_ffi",
    defaults: ["libbt_common_defaults"],
    target: {
        android: {
            rustlibs: [
                "libandroid_logger",
                "librustutils",
            ],
        },
    },
    min_sdk_version: "30",
}

cc_library_static {
    name: "libbt_common_bridge",
    defaults: ["gd_ffi_defaults"],
    generated_headers: [
        "cxx-bridge-header",
        "libbt_common_bridge_header",
    ],
    generated_sources: [
        "libbt_common_bridge_code",
    ],
    export_generated_headers: [
        "cxx-bridge-header",
        "libbt_common_bridge_header",
    ],
    include_dirs: [
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/gd/rust/common",
    ],
    header_libs: ["libbt_keystore_cc_headers"],
    export_header_lib_headers: ["libbt_keystore_cc_headers"],
    cflags: [
        "-Wno-unused-const-variable",
    ],
    host_supported: true,
    shared_libs: [
        "libchrome",
    ],
    min_sdk_version: "30",
}

cc_library_static {
    name: "libbt_keystore_cc",
    defaults: [
        "gd_ffi_defaults",
        "rust_static_cc_lib_defaults",
    ],
    header_libs: ["libbt_keystore_cc_headers"],
    srcs: ["keystore/fake_bt_keystore.cc"],
    generated_headers: [
        "cxx-bridge-header",
        "libbt_common_bridge_header",
    ],
    generated_sources: ["libbt_common_bridge_code"],
    shared_libs: [
        "libchrome",
    ],
    host_supported: true,
    min_sdk_version: "30",
}

cc_library_headers {
    name: "libbt_keystore_cc_headers",
    local_include_dirs: ["keystore"],
    host_supported: true,
    min_sdk_version: "30",
}

cc_library_static {
    name: "libbluetooth_common_rust_interop",
    defaults: ["gd_ffi_defaults"],
    whole_static_libs: [
        "libbt_common_bridge",
        "libbt_common_ffi",
    ],
    host_supported: true,
    min_sdk_version: "30",
}

genrule {
    name: "libbt_common_bridge_header",
    tools: ["cxxbridge"],
    cmd: "$(location cxxbridge) $(in) --header > $(out)",
    srcs: ["src/bridge.rs"],
    out: ["src/bridge.rs.h"],
}

genrule {
    name: "libbt_common_bridge_code",
    tools: ["cxxbridge"],
    cmd: "$(location cxxbridge) $(in) >> $(out)",
    srcs: ["src/bridge.rs"],
    out: ["bridge.cc"],
}

rust_test_host {
@@ -201,14 +54,9 @@ rust_test_host {
    auto_gen_config: true,
    rustlibs: [
        "libbt_common",
        "libcxx",
        "libenv_logger",
        "libfutures",
        "libgrpcio",
        "liblazy_static",
        "liblog_rust",
        "libnix",
        "libtokio",
    ],
    proc_macros: [
        "libpaste",

system/gd/rust/common/BUILD.gn

deleted100644 → 0
+0 −52
Original line number Diff line number Diff line
#
#  Copyright 2021 Google, Inc.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at:
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

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

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

  configs += [
    "//bt/system/gd:gd_defaults",
    "//bt/system/log:log_defaults",
  ]
}

config("rust_common_config") {
  include_dirs = [ "//bt/system/gd/rust/common" ]
}

cxxbridge_header("libbt_common_bridge_header") {
  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",
    "//bt/system/log:log_defaults",
  ]
}

cxxbridge_libheader("cxxlibheader") {
  deps = []
}
+0 −4
Original line number Diff line number Diff line
@@ -36,7 +36,3 @@ tokio = { version = "1.0", features = ['bytes', 'macros', 'net', 'rt-multi-threa

[lib]
crate-type = ["rlib"]

[features]
default = ["keystore"]
keystore = []
Loading