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