1// 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 17cc_library_headers { 18 name: "nos_headers", 19 defaults: ["nos_cc_host_supported_defaults"], 20 export_include_dirs: ["nugget/include"], 21} 22 23cc_defaults { 24 name: "nos_proto_defaults", 25 cflags: [ 26 "-Wno-unused-parameter", 27 ], 28} 29 30cc_defaults { 31 name: "nos_app_defaults", 32 defaults: ["nos_proto_defaults"], 33 header_libs: ["nos_headers"], 34 shared_libs: [ 35 "libnos", 36 "libprotobuf-cpp-full", 37 ], 38} 39 40cc_defaults { 41 name: "nos_app_service_defaults", 42 defaults: [ 43 "nos_app_defaults", 44 "nos_cc_defaults", 45 ], 46 shared_libs: ["libnosprotos"], 47 export_shared_lib_headers: ["libnosprotos"], 48} 49 50// Soong doesn't allow adding plugins to a protobuf compilation so we need to 51// invoke it directly. If we could pass a plugin, it could use insertion points 52// in the .pb.{cc,h} files rather than needing to generate new .client.{cpp,h} 53// files for each service. 54GEN_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" 55 56GEN_SERVICE_SOURCE = GEN_SERVICE + " --nos-client-cpp_out=source:$(genDir) " 57GEN_SERVICE_HEADER = GEN_SERVICE + " --nos-client-cpp_out=header:$(genDir) " 58GEN_SERVICE_MOCK = GEN_SERVICE + " --nos-client-cpp_out=mock:$(genDir) " 59 60// A special target to be statically linkeed into recovery which is a system 61// (not vendor) component. 62cc_library_static { 63 name: "libnos_for_recovery", 64 cflags: [ 65 "-Wall", 66 "-Wextra", 67 "-Werror", 68 "-Wno-zero-length-array", 69 ], 70 export_include_dirs: [ 71 "nugget/include", 72 "libnos/include", 73 "libnos_datagram/include", 74 "libnos_transport/include", 75 ], 76 srcs: [ 77 "libnos/debug.cpp", 78 "libnos_transport/transport.c", 79 "libnos_transport/crc16.c", 80 ], 81 static_libs: [ 82 "libbase", 83 ], 84} 85