blob: bfbcdf7ee3f1ed85459fad28681c05924c5ffe0f [file] [log] [blame]
Andrew Scull1c02d642017-09-11 17:54:56 +01001//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Andrew Scull1c02d642017-09-11 17:54:56 +010017cc_library_headers {
18 name: "nos_headers",
Andrew Scull56ffcc42018-01-17 11:58:38 +000019 defaults: ["nos_cc_host_supported_defaults"],
Andrew Scull1c02d642017-09-11 17:54:56 +010020 export_include_dirs: ["nugget/include"],
21}
22
23cc_defaults {
Andrew Scullaf221e32017-10-12 13:00:53 +010024 name: "nos_proto_defaults",
Andrew Scull1a48a032017-09-26 17:33:22 +010025 cflags: [
26 "-Wno-extended-offsetof",
27 "-Wno-unused-parameter",
28 ],
Andrew Scullaf221e32017-10-12 13:00:53 +010029}
30
31cc_defaults {
32 name: "nos_app_defaults",
33 defaults: ["nos_proto_defaults"],
Andrew Scull87a2caf2017-10-11 14:07:24 +010034 header_libs: ["nos_headers"],
Andrew Scullaf221e32017-10-12 13:00:53 +010035 shared_libs: [
36 "libnos",
37 "libprotobuf-cpp-full",
38 ],
Andrew Scull1c02d642017-09-11 17:54:56 +010039}
40
41cc_defaults {
42 name: "nos_app_service_defaults",
43 defaults: [
44 "nos_app_defaults",
Andrew Scull56ffcc42018-01-17 11:58:38 +000045 "nos_cc_defaults",
Andrew Scull1c02d642017-09-11 17:54:56 +010046 ],
Andrew Scullaf221e32017-10-12 13:00:53 +010047 shared_libs: ["libnosprotos"],
48 export_shared_lib_headers: ["libnosprotos"],
Andrew Scull1c02d642017-09-11 17:54:56 +010049}
50
51// Soong doesn't allow adding plugins to a protobuf compilation so we need to
52// invoke it directly. If we could pass a plugin, it could use insertion points
53// in the .pb.{cc,h} files rather than needing to generate new .client.{cpp,h}
54// files for each service.
Andrew Scull304ad122017-11-10 17:01:41 +000055GEN_SERVICE = "$(location aprotoc) --plugin=protoc-gen-nos-client-cpp=$(location protoc-gen-nos-client-cpp) $(in) -Iexternal/protobuf/src -Iexternal/nos/host/generic/nugget/proto"
Andrew Scull1c02d642017-09-11 17:54:56 +010056
57GEN_SERVICE_SOURCE = GEN_SERVICE + " --nos-client-cpp_out=source:$(genDir) "
58GEN_SERVICE_HEADER = GEN_SERVICE + " --nos-client-cpp_out=header:$(genDir) "
59GEN_SERVICE_MOCK = GEN_SERVICE + " --nos-client-cpp_out=mock:$(genDir) "