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 apex_available: [ 59 "com.android.neuralnetworks", 60 "test_com.android.neuralnetworks", 61 "com.android.extservices", 62 "//apex_available:platform", 63 ], 64} 65 66cc_binary_host { 67 name: "flatc", 68 69 cppflags: [ 70 "-fsigned-char", 71 "-pedantic", 72 "-Wall", 73 "-Werror", 74 "-Wextra", 75 "-Werror=shadow", 76 "-Wno-implicit-fallthrough", // in reflection.cpp 77 ], 78 79 local_include_dirs: [ 80 "grpc", 81 "include", 82 ], 83 84 srcs: [ 85 "src/*.cpp", 86 "grpc/src/compiler/*.cc", 87 ], 88 exclude_srcs: [ 89 "src/flathash.cpp", 90 ], 91} 92 93java_library { 94 name: "flatbuffers-java", 95 srcs: ["java/**/*.java"], 96 sdk_version: "current", 97 98 java_version: "1.8", 99} 100 101cc_library { 102 name: "libflatbuffers-cpp", 103 export_include_dirs: ["include"], 104 cpp_std: "c++17", 105 host_supported: true, 106 vendor_available: true, 107 local_include_dirs: [ 108 "include", 109 ], 110 srcs: [ 111 "src/code_generators.cpp", 112 "src/idl_gen_fbs.cpp", 113 "src/idl_gen_text.cpp", 114 "src/idl_parser.cpp", 115 "src/reflection.cpp", 116 "src/util.cpp", 117 ], 118 apex_available: [ 119 "//apex_available:platform", 120 "com.android.bluetooth", 121 ], 122 min_sdk_version: "30", 123} 124 125cc_defaults { 126 name: "flatbuffers_fuzzer_defaults", 127 srcs: [ 128 "tests/test_assert.cpp", 129 ], 130 shared_libs: [ 131 "liblog", 132 "libflatbuffers-cpp" 133 ], 134 local_include_dirs: [ 135 "tests", 136 "tests/fuzzer", 137 ], 138 fuzz_config: { 139 componentid: 87896 140 } 141} 142 143cc_fuzz { 144 name: "flatbuffers_parser_fuzzer", 145 defaults: ["flatbuffers_fuzzer_defaults"], 146 srcs: [ 147 "tests/fuzzer/flatbuffers_parser_fuzzer.cc" 148 ], 149} 150 151cc_fuzz { 152 name: "flatbuffers_scalar_fuzzer", 153 defaults: ["flatbuffers_fuzzer_defaults"], 154 srcs: [ 155 "tests/fuzzer/flatbuffers_scalar_fuzzer.cc" 156 ], 157} 158 159cc_fuzz { 160 name: "flatbuffers_verifier_fuzzer", 161 defaults: ["flatbuffers_fuzzer_defaults"], 162 srcs: [ 163 "tests/fuzzer/flatbuffers_verifier_fuzzer.cc" 164 ], 165} 166