1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# This BUILD file mimics what bp2build will convert cc modules with aidl srcs to
load("//build/bazel/rules/cc:cc_aidl_library.bzl", "cc_aidl_library")
load("//build/bazel/rules/cc:cc_binary.bzl", "cc_binary")
load("//build/bazel/rules/cc:cc_library_shared.bzl", "cc_library_shared")
load("//build/bazel/rules/cc:cc_library_static.bzl", "cc_library_static")
# Use aidl sources from another package
cc_aidl_library(
name = "foo_cc_aidl_library",
implementation_dynamic_deps = [
"//frameworks/native/libs/binder:libbinder",
"//system/core/libutils:libutils",
],
deps = ["//build/bazel/examples/cc/aidl:foo"],
)
cc_library_shared(
name = "foo",
srcs = ["foo.cpp"],
implementation_dynamic_deps = [
"//frameworks/native/libs/binder:libbinder",
"//system/core/libutils:libutils",
],
whole_archive_deps = [
"foo_cc_aidl_library",
],
)
cc_library_static(
name = "foo_bp2build_cc_library_static",
srcs = ["foo.cpp"],
implementation_dynamic_deps = [
"//frameworks/native/libs/binder:libbinder",
"//system/core/libutils",
],
whole_archive_deps = [
"foo_cc_aidl_library",
],
)
cc_binary(
name = "program_cc_binary",
srcs = ["program.cpp"],
dynamic_deps = [
"//frameworks/native/libs/binder:libbinder",
"//system/core/libutils:libutils",
],
whole_archive_deps = [
"foo_cc_aidl_library",
],
)
|