You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
220 lines
5.8 KiB
220 lines
5.8 KiB
//
|
|
// Copyright (C) 2017 The Android Open Source Project
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
//
|
|
|
|
package {
|
|
default_applicable_licenses: ["external_nos_host_generic_license"],
|
|
}
|
|
|
|
// Added automatically by a large-scale-change that took the approach of
|
|
// 'apply every license found to every target'. While this makes sure we respect
|
|
// every license restriction, it may not be entirely correct.
|
|
//
|
|
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
|
|
//
|
|
// Please consider splitting the single license below into multiple licenses,
|
|
// taking care not to lose any license_kind information, and overriding the
|
|
// default license using the 'licenses: [...]' property on targets as needed.
|
|
//
|
|
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
|
|
// to attach the license to, and including a comment whether the files may be
|
|
// used in the current project.
|
|
// See: http://go/android-license-faq
|
|
license {
|
|
name: "external_nos_host_generic_license",
|
|
visibility: [":__subpackages__"],
|
|
license_kinds: [
|
|
"SPDX-license-identifier-Apache-2.0",
|
|
"SPDX-license-identifier-BSD",
|
|
],
|
|
license_text: [
|
|
"LICENSE",
|
|
],
|
|
}
|
|
|
|
cc_library_headers {
|
|
name: "nos_headers",
|
|
defaults: ["nos_cc_host_supported_defaults"],
|
|
export_include_dirs: ["nugget/include"],
|
|
}
|
|
|
|
cc_defaults {
|
|
name: "nos_proto_defaults",
|
|
cflags: [
|
|
"-Wno-unused-parameter",
|
|
],
|
|
}
|
|
|
|
cc_defaults {
|
|
name: "nos_app_defaults",
|
|
defaults: ["nos_proto_defaults"],
|
|
header_libs: ["nos_headers"],
|
|
shared_libs: [
|
|
"libnos",
|
|
"libprotobuf-cpp-full",
|
|
],
|
|
}
|
|
|
|
cc_defaults {
|
|
name: "nos_app_service_defaults",
|
|
defaults: [
|
|
"nos_app_defaults",
|
|
"nos_cc_defaults",
|
|
],
|
|
shared_libs: ["libnosprotos"],
|
|
export_shared_lib_headers: ["libnosprotos"],
|
|
}
|
|
|
|
// Soong doesn't allow adding plugins to a protobuf compilation so we need to
|
|
// invoke it directly. If we could pass a plugin, it could use insertion points
|
|
// in the .pb.{cc,h} files rather than needing to generate new .client.{cpp,h}
|
|
// files for each service.
|
|
GEN_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"
|
|
|
|
GEN_SERVICE_SOURCE = GEN_SERVICE + " --nos-client-cpp_out=source:$(genDir) "
|
|
GEN_SERVICE_HEADER = GEN_SERVICE + " --nos-client-cpp_out=header:$(genDir) "
|
|
GEN_SERVICE_MOCK = GEN_SERVICE + " --nos-client-cpp_out=mock:$(genDir) "
|
|
|
|
// A special target to be statically linkeed into recovery which is a system
|
|
// (not vendor) component.
|
|
cc_library_static {
|
|
name: "libnos_for_recovery",
|
|
cflags: [
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Werror",
|
|
"-Wno-zero-length-array",
|
|
],
|
|
export_include_dirs: [
|
|
"nugget/include",
|
|
"libnos/include",
|
|
"libnos_datagram/include",
|
|
"libnos_transport/include",
|
|
],
|
|
srcs: [
|
|
"libnos/debug.cpp",
|
|
"libnos_transport/transport.c",
|
|
"libnos_transport/crc16.c",
|
|
],
|
|
static_libs: [
|
|
"libbase",
|
|
],
|
|
}
|
|
|
|
// A special target to be statically linkeed into fastboot hal.
|
|
cc_library_static {
|
|
name: "libnos_for_fastboot",
|
|
recovery: true,
|
|
cflags: [
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Werror",
|
|
"-Wno-zero-length-array",
|
|
],
|
|
export_include_dirs: [
|
|
"nugget/include",
|
|
"libnos/include",
|
|
"libnos_datagram/include",
|
|
"libnos_transport/include",
|
|
],
|
|
srcs: [
|
|
"libnos/debug.cpp",
|
|
"libnos_transport/transport.c",
|
|
"libnos_transport/crc16.c",
|
|
],
|
|
static_libs: [
|
|
"libbase",
|
|
],
|
|
}
|
|
|
|
// A special target to be statically linkeed into recovery which is a system
|
|
// (not vendor) component.
|
|
cc_library_static {
|
|
name: "libnos_citadel_for_recovery",
|
|
cflags: [
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Werror",
|
|
],
|
|
srcs: [
|
|
":libnos_client",
|
|
"libnos_datagram/citadel.c",
|
|
],
|
|
static_libs: [
|
|
"libnos_for_recovery",
|
|
],
|
|
}
|
|
|
|
// A special target to be statically linkeed into fastboot hal.
|
|
cc_library_static {
|
|
name: "libnos_citadel_for_fastboot",
|
|
recovery: true,
|
|
cflags: [
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Werror",
|
|
],
|
|
srcs: [
|
|
":libnos_client",
|
|
"libnos_datagram/citadel.c",
|
|
],
|
|
static_libs: [
|
|
"libnos_for_fastboot",
|
|
],
|
|
}
|
|
|
|
// Language and vendor related defaults
|
|
cc_defaults {
|
|
name: "nos_cc_defaults",
|
|
clang: true,
|
|
cflags: [
|
|
"-pedantic",
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Werror",
|
|
"-Wno-gnu-zero-variadic-macro-arguments",
|
|
"-Wno-zero-length-array",
|
|
],
|
|
conlyflags: [
|
|
"-std=c11",
|
|
],
|
|
vendor: true,
|
|
owner: "google",
|
|
}
|
|
|
|
// Defaults for components under the hw subdirectory
|
|
cc_defaults {
|
|
name: "nos_cc_hw_defaults",
|
|
defaults: ["nos_cc_defaults"],
|
|
relative_install_path: "hw",
|
|
}
|
|
|
|
// Defaults for components shared between the host and device
|
|
cc_defaults {
|
|
name: "nos_cc_host_supported_defaults",
|
|
defaults: ["nos_cc_defaults"],
|
|
host_supported: true,
|
|
}
|
|
|
|
cc_library {
|
|
name: "libnos_client_citadel",
|
|
srcs: [":libnos_client"],
|
|
defaults: [
|
|
"libnos_client_defaults",
|
|
"nos_cc_defaults",
|
|
],
|
|
shared_libs: ["libnos_datagram_citadel"],
|
|
}
|