1// Copyright 2024 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 // See: http://go/android-license-faq 17 // A large-scale-change added 'default_applicable_licenses' to import 18 // all of the 'license_kinds' from "frameworks_native_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 default_applicable_licenses: ["frameworks_native_license"], 22} 23 24cc_defaults { 25 name: "libfeatureoverride_deps", 26 include_dirs: [ 27 "external/protobuf", 28 "external/protobuf/src", 29 ], 30 header_libs: [ 31 "libbase_headers", 32 ], 33 shared_libs: [ 34 "libbase", 35 "libgraphicsenv", 36 "liblog", 37 "libprotobuf-cpp-lite", 38 ], 39} 40 41filegroup { 42 name: "feature_config_proto_definitions", 43 srcs: [ 44 "proto/feature_config.proto", 45 ], 46} 47 48genrule { 49 name: "feature_config_proto_lite_gen_headers", 50 srcs: [ 51 ":feature_config_proto_definitions", 52 ], 53 tools: [ 54 "aprotoc", 55 ], 56 cmd: "$(location aprotoc) " + 57 "--proto_path=frameworks/native/services/gpuservice/feature_override " + 58 "--cpp_out=lite=true:$(genDir)/frameworks/native/services/gpuservice/feature_override " + 59 "$(locations :feature_config_proto_definitions)", 60 out: [ 61 "frameworks/native/services/gpuservice/feature_override/proto/feature_config.pb.h", 62 ], 63 export_include_dirs: [ 64 "frameworks/native/services/gpuservice/feature_override/proto/", 65 ], 66} 67 68cc_library_static { 69 name: "libfeatureoverride", 70 defaults: [ 71 "libfeatureoverride_deps", 72 "libvkjson_deps", 73 ], 74 srcs: [ 75 ":feature_config_proto_definitions", 76 "FeatureOverrideParser.cpp", 77 ], 78 local_include_dirs: [ 79 "include", 80 ], 81 cflags: [ 82 "-Wall", 83 "-Werror", 84 "-Wimplicit-fallthrough", 85 ], 86 cppflags: [ 87 "-Wno-sign-compare", 88 ], 89 static_libs: [ 90 "libvkjson", 91 ], 92 export_include_dirs: ["include"], 93 proto: { 94 type: "lite", 95 static: true, 96 }, 97 generated_headers: [ 98 "feature_config_proto_lite_gen_headers", 99 ], 100} 101