xref: /aosp_15_r20/external/wmediumd/Android.bp (revision 621120a22a0cd8ba80b131fe8bcb37c86ff453e3)
1package {
2    default_applicable_licenses: ["external_wmediumd_license"],
3}
4
5license {
6    name: "external_wmediumd_license",
7    visibility: [":__subpackages__"],
8    license_kinds: [
9        "SPDX-license-identifier-Apache-2.0",
10        "SPDX-license-identifier-GPL-2.0",
11    ],
12    license_text: [
13        "LICENSE",
14    ],
15}
16
17wmediumd_version = "0.3.1"
18
19cc_binary_host {
20    name: "wmediumd_gen_config",
21    srcs: [
22        "util/wmediumd_gen_config.c",
23    ],
24    static_libs: [
25        "libconfig",
26    ],
27    visibility: [
28        "//device/google/cuttlefish/build",
29    ],
30}
31
32cc_library_host_static {
33    name: "libwmediumd_server",
34    shared_libs: [
35        "libgflags",
36        "libgrpc++_unsecure",
37        "libprotobuf-cpp-full",
38    ],
39    cflags: [
40        "-Wno-unused-parameter",
41    ],
42    generated_headers: [
43        "WmediumdServerProto_h",
44    ],
45    generated_sources: [
46        "WmediumdServerProto_cc",
47    ],
48    export_generated_headers: [
49        "WmediumdServerProto_h",
50    ],
51}
52
53filegroup {
54    name: "WmediumdServerProto",
55    srcs: [
56        "wmediumd_server/wmediumd.proto",
57    ],
58}
59
60// TODO(278065934): Add a module type for grpc service
61genrule {
62    name: "WmediumdServerProto_h",
63    tools: [
64        "aprotoc",
65        "protoc-gen-grpc-cpp-plugin",
66    ],
67    cmd: "$(location aprotoc) -Iexternal/wmediumd/wmediumd_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location :WmediumdServerProto) --grpc_out=$(genDir) --cpp_out=$(genDir)",
68    srcs: [
69        ":libprotobuf-internal-protos",
70        ":WmediumdServerProto",
71    ],
72    out: [
73        "wmediumd.grpc.pb.h",
74        "wmediumd.pb.h",
75    ],
76}
77
78genrule {
79    name: "WmediumdServerProto_cc",
80    tools: [
81        "aprotoc",
82        "protoc-gen-grpc-cpp-plugin",
83    ],
84    cmd: "$(location aprotoc) -Iexternal/wmediumd/wmediumd_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location :WmediumdServerProto) --grpc_out=$(genDir) --cpp_out=$(genDir)",
85    srcs: [
86        ":libprotobuf-internal-protos",
87        ":WmediumdServerProto",
88    ],
89    out: [
90        "wmediumd.grpc.pb.cc",
91        "wmediumd.pb.cc",
92    ],
93}
94
95java_library_host {
96    name: "WmediumdServerProto_java",
97    srcs: [
98        ":WmediumdServerProto",
99    ],
100    static_libs: [
101        "libprotobuf-java-full",
102    ],
103    proto: {
104        canonical_path_from_root: false,
105        type: "full",
106        include_dirs: [
107            "external/protobuf/src",
108        ],
109    },
110}
111
112cc_binary_host {
113    name: "wmediumd",
114    srcs: [
115        "main.cc",
116        "wmediumd_server/wmediumd_server.cc",
117        "wmediumd/*.c",
118        "wmediumd/lib/*.c",
119    ],
120    local_include_dirs: [
121        "wmediumd/inc",
122    ],
123    cflags: [
124        "-g",
125        "-Wno-unused-parameter",
126        "-Wno-format-zero-length",
127        "-DCONFIG_LIBNL30",
128        "-DVERSION_STR=\"" + wmediumd_version + "\"",
129        "-Wno-pointer-arith",
130        "-Wno-unused-result",
131        "-Wno-gnu-variable-sized-type-not-at-end",
132        "-Wno-unused-function",
133    ],
134    shared_libs: [
135        "libbase",
136        "libnl",
137        "libgflags",
138        "libgrpc++_unsecure",
139        "libprotobuf-cpp-full",
140    ],
141    static_libs: [
142        "libconfig",
143        "libgrpc++_reflection",
144        "libwmediumd_server",
145    ],
146    visibility: [
147        "//device/google/cuttlefish/build",
148    ],
149}
150
151cc_binary_host {
152    name: "wmediumd_ack_test_client",
153    srcs: [
154        "tests/wmediumd_ack_test_client.c",
155    ],
156    local_include_dirs: [
157        "wmediumd/inc",
158    ],
159    visibility: [
160        "//device/google/cuttlefish/build",
161    ],
162    stl: "none",
163    static_executable: true,
164}
165
166cc_library_headers {
167    name: "wmediumd_headers",
168    export_include_dirs: [
169        ".",
170    ],
171    visibility: [
172        "//device/google/cuttlefish/host/libs/wmediumd_controller",
173        "//device/google/cuttlefish/host/commands/wmediumd_control",
174    ],
175    stl: "none",
176    host_supported: true,
177    vendor_available: true,
178}
179