blob: c1c0308cff720383239c3cffb716cca92ac532bd [file] [log] [blame]
Miao Wanga69e27d2017-12-07 14:14:14 -08001// 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
Bob Badour40ce0942021-02-12 15:28:37 -080015package {
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
Miao Wanga69e27d2017-12-07 14:14:14 -080052cc_library_headers {
53 name: "flatbuffer_headers",
54 export_include_dirs: ["include"],
I-Jui (Ray) Sunge72bb4d2018-02-21 14:38:42 -080055 vendor_available: true,
Shih-Ming Wanga7ab9662021-01-19 15:00:02 -080056 host_supported: true,
Tony Makd7ee8fa2019-06-12 15:53:47 +010057 sdk_version: "current",
Lev Proleeva56470c2020-02-10 14:28:06 +000058 apex_available: [
59 "com.android.neuralnetworks",
60 "test_com.android.neuralnetworks",
Jiyong Park5e46dd02020-04-28 17:11:04 +090061 "com.android.extservices",
Lev Proleeva56470c2020-02-10 14:28:06 +000062 "//apex_available:platform",
63 ],
I-Jui (Ray) Sunge72bb4d2018-02-21 14:38:42 -080064}
khmel@google.com9deea582018-06-01 16:38:52 -070065
66cc_binary_host {
67 name: "flatc",
68
69 cppflags: [
70 "-fsigned-char",
71 "-pedantic",
72 "-Wall",
73 "-Werror",
74 "-Wextra",
75 "-Werror=shadow",
Haibo Huangb9f6b1a2020-03-16 15:41:29 -070076 "-Wno-implicit-fallthrough", // in reflection.cpp
khmel@google.com9deea582018-06-01 16:38:52 -070077 ],
78
79 local_include_dirs: [
80 "grpc",
81 "include",
82 ],
83
84 srcs: [
Haibo Huangb9f6b1a2020-03-16 15:41:29 -070085 "src/*.cpp",
86 "grpc/src/compiler/*.cc",
87 ],
88 exclude_srcs: [
89 "src/flathash.cpp",
khmel@google.com9deea582018-06-01 16:38:52 -070090 ],
91}
Colin Crossc41f0602019-03-22 13:31:17 -070092
93java_library {
94 name: "flatbuffers-java",
95 srcs: ["java/**/*.java"],
96 sdk_version: "current",
97
98 java_version: "1.8",
99}
Chris Manton0d42ca22020-05-28 08:32:45 -0700100
101cc_library {
102 name: "libflatbuffers-cpp",
103 export_include_dirs: ["include"],
Chris Mantone87b31d2020-07-13 12:14:57 -0700104 cpp_std: "c++17",
Chris Manton0d42ca22020-05-28 08:32:45 -0700105 host_supported: true,
Shih-Ming Wanga7ab9662021-01-19 15:00:02 -0800106 vendor_available: true,
Chris Manton0d42ca22020-05-28 08:32:45 -0700107 local_include_dirs: [
Chris Manton0d42ca22020-05-28 08:32:45 -0700108 "include",
109 ],
110 srcs: [
Chris Mantone87b31d2020-07-13 12:14:57 -0700111 "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",
Chris Manton0d42ca22020-05-28 08:32:45 -0700117 ],
118 apex_available: [
119 "//apex_available:platform",
120 "com.android.bluetooth.updatable",
121 ],
122}
Branden Archer3f4433d2020-10-31 22:27:33 -0700123
124cc_defaults {
125 name: "flatbuffers_fuzzer_defaults",
126 srcs: [
127 "tests/test_assert.cpp",
128 ],
129 shared_libs: [
130 "liblog",
131 "libflatbuffers-cpp"
132 ],
133 local_include_dirs: [
134 "tests",
135 "tests/fuzzer",
136 ],
Branden Archerf1b56872020-11-12 19:57:29 -0800137 fuzz_config: {
138 componentid: 87896
139 }
Branden Archer3f4433d2020-10-31 22:27:33 -0700140}
141
142cc_fuzz {
143 name: "flatbuffers_parser_fuzzer",
144 defaults: ["flatbuffers_fuzzer_defaults"],
145 srcs: [
146 "tests/fuzzer/flatbuffers_parser_fuzzer.cc"
147 ],
148}
149
150cc_fuzz {
151 name: "flatbuffers_scalar_fuzzer",
152 defaults: ["flatbuffers_fuzzer_defaults"],
153 srcs: [
154 "tests/fuzzer/flatbuffers_scalar_fuzzer.cc"
155 ],
156}
157
158cc_fuzz {
159 name: "flatbuffers_verifier_fuzzer",
160 defaults: ["flatbuffers_fuzzer_defaults"],
161 srcs: [
162 "tests/fuzzer/flatbuffers_verifier_fuzzer.cc"
163 ],
164}