1// Copyright (C) 2017 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 default_applicable_licenses: ["external_flatbuffers_license"], 17} 18 19// Added automatically by a large-scale-change that took the approach of 20// 'apply every license found to every target'. While this makes sure we respect 21// every license restriction, it may not be entirely correct. 22// 23// e.g. GPL in an MIT project might only apply to the contrib/ directory. 24// 25// Please consider splitting the single license below into multiple licenses, 26// taking care not to lose any license_kind information, and overriding the 27// default license using the 'licenses: [...]' property on targets as needed. 28// 29// For unused files, consider creating a 'fileGroup' with "//visibility:private" 30// to attach the license to, and including a comment whether the files may be 31// used in the current project. 32// 33// large-scale-change included anything that looked like it might be a license 34// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. 35// 36// Please consider removing redundant or irrelevant files from 'license_text:'. 37// See: http://go/android-license-faq 38license { 39 name: "external_flatbuffers_license", 40 visibility: [":__subpackages__"], 41 license_kinds: [ 42 "SPDX-license-identifier-Apache-2.0", 43 "SPDX-license-identifier-BSD", 44 "SPDX-license-identifier-Zlib", 45 ], 46 license_text: [ 47 "LICENSE", 48 "LICENSE.txt", 49 ], 50} 51 52cc_library_headers { 53 name: "flatbuffer_headers", 54 export_include_dirs: ["include"], 55 vendor_available: true, 56 host_supported: true, 57 sdk_version: "current", 58 min_sdk_version: "apex_inherit", 59 apex_available: [ 60 "com.android.adservices", 61 "com.android.extservices", 62 "com.android.neuralnetworks", 63 "com.android.ondevicepersonalization", 64 "test_com.android.neuralnetworks", 65 "//apex_available:platform", 66 ], 67} 68 69cc_binary_host { 70 name: "flatc", 71 72 cppflags: [ 73 "-fsigned-char", 74 "-pedantic", 75 "-Wall", 76 "-Werror", 77 "-Wextra", 78 "-Werror=shadow", 79 "-Wno-implicit-fallthrough", // in reflection.cpp 80 ], 81 82 local_include_dirs: [ 83 "grpc", 84 "include", 85 ], 86 87 srcs: [ 88 "src/*.cpp", 89 "grpc/src/compiler/*.cc", 90 ], 91 exclude_srcs: [ 92 "src/flathash.cpp", 93 ], 94} 95 96java_library { 97 name: "flatbuffers-java", 98 srcs: ["java/**/*.java"], 99 sdk_version: "current", 100 min_sdk_version: "30", 101 102 java_version: "1.8", 103 apex_available: [ 104 "//apex_available:platform", 105 "com.android.ondevicepersonalization", 106 ], 107} 108 109cc_library { 110 name: "libflatbuffers-cpp", 111 export_include_dirs: ["include"], 112 sdk_version: "current", 113 stl: "libc++_static", 114 host_supported: true, 115 vendor_available: true, 116 local_include_dirs: [ 117 "include", 118 ], 119 srcs: [ 120 "src/code_generators.cpp", 121 "src/idl_gen_fbs.cpp", 122 "src/idl_gen_text.cpp", 123 "src/idl_parser.cpp", 124 "src/reflection.cpp", 125 "src/util.cpp", 126 ], 127 apex_available: [ 128 "//apex_available:platform", 129 "com.android.btservices", 130 "com.android.extservices", 131 ], 132 min_sdk_version: "30", 133} 134 135cc_defaults { 136 name: "flatbuffers_fuzzer_defaults", 137 srcs: [ 138 "tests/test_assert.cpp", 139 ], 140 shared_libs: [ 141 "liblog", 142 "libflatbuffers-cpp" 143 ], 144 local_include_dirs: [ 145 "tests", 146 "tests/fuzzer", 147 ], 148 fuzz_config: { 149 componentid: 87896 150 } 151} 152 153cc_fuzz { 154 name: "flatbuffers_parser_fuzzer", 155 defaults: ["flatbuffers_fuzzer_defaults"], 156 srcs: [ 157 "tests/fuzzer/flatbuffers_parser_fuzzer.cc" 158 ], 159} 160 161cc_fuzz { 162 name: "flatbuffers_scalar_fuzzer", 163 defaults: ["flatbuffers_fuzzer_defaults"], 164 srcs: [ 165 "tests/fuzzer/flatbuffers_scalar_fuzzer.cc" 166 ], 167} 168 169cc_fuzz { 170 name: "flatbuffers_verifier_fuzzer", 171 defaults: ["flatbuffers_fuzzer_defaults"], 172 srcs: [ 173 "tests/fuzzer/flatbuffers_verifier_fuzzer.cc" 174 ], 175} 176