• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
68    srcs: [
69        ":WmediumdServerProto",
70    ],
71    out: [
72        "wmediumd.grpc.pb.h",
73        "wmediumd.pb.h",
74    ],
75}
76
77genrule {
78    name: "WmediumdServerProto_cc",
79    tools: [
80        "aprotoc",
81        "protoc-gen-grpc-cpp-plugin",
82    ],
83    cmd: "$(location aprotoc) -Iexternal/wmediumd/wmediumd_server -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
84    srcs: [
85        ":WmediumdServerProto",
86    ],
87    out: [
88        "wmediumd.grpc.pb.cc",
89        "wmediumd.pb.cc",
90    ],
91}
92
93cc_binary_host {
94    name: "wmediumd",
95    srcs: [
96        "main.cc",
97        "wmediumd_server/wmediumd_server.cc",
98        "wmediumd/*.c",
99        "wmediumd/lib/*.c",
100    ],
101    local_include_dirs: [
102        "wmediumd/inc",
103    ],
104    cflags: [
105        "-g",
106        "-Wno-unused-parameter",
107        "-Wno-format-zero-length",
108        "-DCONFIG_LIBNL30",
109        "-DVERSION_STR=\"" + wmediumd_version + "\"",
110        "-Wno-pointer-arith",
111        "-Wno-unused-result",
112        "-Wno-gnu-variable-sized-type-not-at-end",
113        "-Wno-unused-function",
114    ],
115    shared_libs: [
116        "libbase",
117        "libnl",
118        "libgflags",
119        "libgrpc++_unsecure",
120        "libprotobuf-cpp-full",
121    ],
122    static_libs: [
123        "libconfig",
124        "libgrpc++_reflection",
125        "libwmediumd_server",
126    ],
127    cpp_std: "c++17",
128    visibility: [
129        "//device/google/cuttlefish/build",
130    ],
131}
132
133cc_binary_host {
134    name: "wmediumd_ack_test_client",
135    srcs: [
136        "tests/wmediumd_ack_test_client.c",
137    ],
138    local_include_dirs: [
139        "wmediumd/inc",
140    ],
141    visibility: [
142        "//device/google/cuttlefish/build",
143    ],
144    stl: "none",
145    static_executable: true,
146}
147
148cc_library_headers {
149    name: "wmediumd_headers",
150    export_include_dirs: [
151        ".",
152    ],
153    visibility: [
154        "//device/google/cuttlefish/host/libs/wmediumd_controller",
155        "//device/google/cuttlefish/host/commands/wmediumd_control",
156    ],
157    stl: "none",
158    host_supported: true,
159    vendor_available: true,
160}
161