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