Miao Wang | a69e27d | 2017-12-07 14:14:14 -0800 | [diff] [blame] | 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 | |
Bob Badour | 40ce094 | 2021-02-12 15:28:37 -0800 | [diff] [blame] | 15 | package { |
| 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 |
| 38 | license { |
| 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 Wang | a69e27d | 2017-12-07 14:14:14 -0800 | [diff] [blame] | 52 | cc_library_headers { |
| 53 | name: "flatbuffer_headers", |
| 54 | export_include_dirs: ["include"], |
I-Jui (Ray) Sung | e72bb4d | 2018-02-21 14:38:42 -0800 | [diff] [blame] | 55 | vendor_available: true, |
Shih-Ming Wang | a7ab966 | 2021-01-19 15:00:02 -0800 | [diff] [blame] | 56 | host_supported: true, |
Tony Mak | d7ee8fa | 2019-06-12 15:53:47 +0100 | [diff] [blame] | 57 | sdk_version: "current", |
Lev Proleev | a56470c | 2020-02-10 14:28:06 +0000 | [diff] [blame] | 58 | apex_available: [ |
| 59 | "com.android.neuralnetworks", |
| 60 | "test_com.android.neuralnetworks", |
Jiyong Park | 5e46dd0 | 2020-04-28 17:11:04 +0900 | [diff] [blame] | 61 | "com.android.extservices", |
Lev Proleev | a56470c | 2020-02-10 14:28:06 +0000 | [diff] [blame] | 62 | "//apex_available:platform", |
| 63 | ], |
I-Jui (Ray) Sung | e72bb4d | 2018-02-21 14:38:42 -0800 | [diff] [blame] | 64 | } |
khmel@google.com | 9deea58 | 2018-06-01 16:38:52 -0700 | [diff] [blame] | 65 | |
| 66 | cc_binary_host { |
| 67 | name: "flatc", |
| 68 | |
| 69 | cppflags: [ |
| 70 | "-fsigned-char", |
| 71 | "-pedantic", |
| 72 | "-Wall", |
| 73 | "-Werror", |
| 74 | "-Wextra", |
| 75 | "-Werror=shadow", |
Haibo Huang | b9f6b1a | 2020-03-16 15:41:29 -0700 | [diff] [blame] | 76 | "-Wno-implicit-fallthrough", // in reflection.cpp |
khmel@google.com | 9deea58 | 2018-06-01 16:38:52 -0700 | [diff] [blame] | 77 | ], |
| 78 | |
| 79 | local_include_dirs: [ |
| 80 | "grpc", |
| 81 | "include", |
| 82 | ], |
| 83 | |
| 84 | srcs: [ |
Haibo Huang | b9f6b1a | 2020-03-16 15:41:29 -0700 | [diff] [blame] | 85 | "src/*.cpp", |
| 86 | "grpc/src/compiler/*.cc", |
| 87 | ], |
| 88 | exclude_srcs: [ |
| 89 | "src/flathash.cpp", |
khmel@google.com | 9deea58 | 2018-06-01 16:38:52 -0700 | [diff] [blame] | 90 | ], |
| 91 | } |
Colin Cross | c41f060 | 2019-03-22 13:31:17 -0700 | [diff] [blame] | 92 | |
| 93 | java_library { |
| 94 | name: "flatbuffers-java", |
| 95 | srcs: ["java/**/*.java"], |
| 96 | sdk_version: "current", |
| 97 | |
| 98 | java_version: "1.8", |
| 99 | } |
Chris Manton | 0d42ca2 | 2020-05-28 08:32:45 -0700 | [diff] [blame] | 100 | |
| 101 | cc_library { |
| 102 | name: "libflatbuffers-cpp", |
| 103 | export_include_dirs: ["include"], |
Chris Manton | e87b31d | 2020-07-13 12:14:57 -0700 | [diff] [blame] | 104 | cpp_std: "c++17", |
Chris Manton | 0d42ca2 | 2020-05-28 08:32:45 -0700 | [diff] [blame] | 105 | host_supported: true, |
Shih-Ming Wang | a7ab966 | 2021-01-19 15:00:02 -0800 | [diff] [blame] | 106 | vendor_available: true, |
Chris Manton | 0d42ca2 | 2020-05-28 08:32:45 -0700 | [diff] [blame] | 107 | local_include_dirs: [ |
Chris Manton | 0d42ca2 | 2020-05-28 08:32:45 -0700 | [diff] [blame] | 108 | "include", |
| 109 | ], |
| 110 | srcs: [ |
Chris Manton | e87b31d | 2020-07-13 12:14:57 -0700 | [diff] [blame] | 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", |
Chris Manton | 0d42ca2 | 2020-05-28 08:32:45 -0700 | [diff] [blame] | 117 | ], |
| 118 | apex_available: [ |
| 119 | "//apex_available:platform", |
| 120 | "com.android.bluetooth.updatable", |
| 121 | ], |
| 122 | } |
Branden Archer | 3f4433d | 2020-10-31 22:27:33 -0700 | [diff] [blame] | 123 | |
| 124 | cc_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 Archer | f1b5687 | 2020-11-12 19:57:29 -0800 | [diff] [blame] | 137 | fuzz_config: { |
| 138 | componentid: 87896 |
| 139 | } |
Branden Archer | 3f4433d | 2020-10-31 22:27:33 -0700 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | cc_fuzz { |
| 143 | name: "flatbuffers_parser_fuzzer", |
| 144 | defaults: ["flatbuffers_fuzzer_defaults"], |
| 145 | srcs: [ |
| 146 | "tests/fuzzer/flatbuffers_parser_fuzzer.cc" |
| 147 | ], |
| 148 | } |
| 149 | |
| 150 | cc_fuzz { |
| 151 | name: "flatbuffers_scalar_fuzzer", |
| 152 | defaults: ["flatbuffers_fuzzer_defaults"], |
| 153 | srcs: [ |
| 154 | "tests/fuzzer/flatbuffers_scalar_fuzzer.cc" |
| 155 | ], |
| 156 | } |
| 157 | |
| 158 | cc_fuzz { |
| 159 | name: "flatbuffers_verifier_fuzzer", |
| 160 | defaults: ["flatbuffers_fuzzer_defaults"], |
| 161 | srcs: [ |
| 162 | "tests/fuzzer/flatbuffers_verifier_fuzzer.cc" |
| 163 | ], |
| 164 | } |