aboutsummaryrefslogtreecommitdiff
path: root/Android.bp
blob: f757884e7a5f4ff1d8ebd4d14e5229bfdc1fb758 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package {
    default_applicable_licenses: ["external_wmediumd_license"],
}

license {
    name: "external_wmediumd_license",
    visibility: [":__subpackages__"],
    license_kinds: [
        "SPDX-license-identifier-Apache-2.0",
        "SPDX-license-identifier-GPL-2.0",
    ],
    license_text: [
        "LICENSE",
    ],
}

wmediumd_version = "0.3.1"

cc_binary_host {
    name: "wmediumd_gen_config",
    srcs: [
        "util/wmediumd_gen_config.c",
    ],
    static_libs: [
        "libconfig",
    ],
    visibility: [
        "//device/google/cuttlefish/build",
    ],
}

cc_library_host_static {
    name: "libwmediumd_server",
    shared_libs: [
        "libgflags",
        "libgrpc++_unsecure",
        "libprotobuf-cpp-full",
    ],
    cflags: [
        "-Wno-unused-parameter",
    ],
    generated_headers: [
        "WmediumdServerProto_h",
    ],
    generated_sources: [
        "WmediumdServerProto_cc",
    ],
    export_generated_headers: [
        "WmediumdServerProto_h",
    ],
}

filegroup {
    name: "WmediumdServerProto",
    srcs: [
        "wmediumd_server/wmediumd.proto",
    ],
}

// TODO(278065934): Add a module type for grpc service
genrule {
    name: "WmediumdServerProto_h",
    tools: [
        "aprotoc",
        "protoc-gen-grpc-cpp-plugin",
    ],
    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)",
    srcs: [
        ":WmediumdServerProto",
    ],
    out: [
        "wmediumd.grpc.pb.h",
        "wmediumd.pb.h",
    ],
}

genrule {
    name: "WmediumdServerProto_cc",
    tools: [
        "aprotoc",
        "protoc-gen-grpc-cpp-plugin",
    ],
    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)",
    srcs: [
        ":WmediumdServerProto",
    ],
    out: [
        "wmediumd.grpc.pb.cc",
        "wmediumd.pb.cc",
    ],
}

java_library_host {
    name: "WmediumdServerProto_java",
    srcs: [
        ":WmediumdServerProto",
    ],
    static_libs: [
        "libprotobuf-java-full",
    ],
    proto: {
        canonical_path_from_root: false,
        type: "full",
        include_dirs: [
            "external/protobuf/src",
        ],
    },
}

cc_binary_host {
    name: "wmediumd",
    srcs: [
        "main.cc",
        "wmediumd_server/wmediumd_server.cc",
        "wmediumd/*.c",
        "wmediumd/lib/*.c",
    ],
    local_include_dirs: [
        "wmediumd/inc",
    ],
    cflags: [
        "-g",
        "-Wno-unused-parameter",
        "-Wno-format-zero-length",
        "-DCONFIG_LIBNL30",
        "-DVERSION_STR=\"" + wmediumd_version + "\"",
        "-Wno-pointer-arith",
        "-Wno-unused-result",
        "-Wno-gnu-variable-sized-type-not-at-end",
        "-Wno-unused-function",
    ],
    shared_libs: [
        "libbase",
        "libnl",
        "libgflags",
        "libgrpc++_unsecure",
        "libprotobuf-cpp-full",
    ],
    static_libs: [
        "libconfig",
        "libgrpc++_reflection",
        "libwmediumd_server",
    ],
    cpp_std: "c++17",
    visibility: [
        "//device/google/cuttlefish/build",
    ],
}

cc_binary_host {
    name: "wmediumd_ack_test_client",
    srcs: [
        "tests/wmediumd_ack_test_client.c",
    ],
    local_include_dirs: [
        "wmediumd/inc",
    ],
    visibility: [
        "//device/google/cuttlefish/build",
    ],
    stl: "none",
    static_executable: true,
}

cc_library_headers {
    name: "wmediumd_headers",
    export_include_dirs: [
        ".",
    ],
    visibility: [
        "//device/google/cuttlefish/host/libs/wmediumd_controller",
        "//device/google/cuttlefish/host/commands/wmediumd_control",
    ],
    stl: "none",
    host_supported: true,
    vendor_available: true,
}