Alexander Dorokhine | 0b4a315 | 2021-03-03 16:01:42 -0800 | [diff] [blame] | 1 | // Copyright (C) 2019 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 | |
| 15 | java_library { |
| 16 | name: "icing-java-proto-lite", |
| 17 | proto: { |
| 18 | // If you change the proto type, also update jarjar-rules.txt to match |
| 19 | // the corresponding proto lib's package path. |
| 20 | type: "lite", |
| 21 | include_dirs: ["external/protobuf/src"], |
| 22 | canonical_path_from_root: false, |
| 23 | }, |
| 24 | srcs: ["icing/proto/*.proto"], |
| 25 | jarjar_rules: "jarjar-rules.txt", |
| 26 | sdk_version: "core_current", |
| 27 | } |
| 28 | |
| 29 | cc_defaults { |
| 30 | name: "libicing_defaults", |
| 31 | |
| 32 | // For debug / treemap purposes. |
| 33 | //strip: { |
| 34 | // keep_symbols: true, |
| 35 | //}, |
| 36 | |
| 37 | cflags: [ |
| 38 | "-Wall", |
| 39 | "-Werror", |
| 40 | "-Wextra", |
| 41 | "-Wno-deprecated-declarations", |
| 42 | "-Wno-ignored-qualifiers", |
| 43 | "-Wno-missing-field-initializers", |
| 44 | "-Wno-sign-compare", |
| 45 | "-Wno-tautological-constant-out-of-range-compare", |
| 46 | "-Wno-undefined-var-template", |
| 47 | "-Wno-unused-function", |
| 48 | "-Wno-unused-parameter", |
| 49 | "-Wno-extern-c-compat", |
| 50 | |
| 51 | "-funsigned-char", |
| 52 | "-fvisibility=hidden", |
| 53 | ], |
| 54 | } |
| 55 | |
| 56 | cc_library_static { |
| 57 | name: "icing-c-proto", |
| 58 | defaults: ["libicing_defaults"], |
| 59 | proto: { |
| 60 | type: "lite", |
| 61 | // Find protos relative from where they're specified (useful for external protos) |
| 62 | canonical_path_from_root: false, |
| 63 | // Need to be able to see the .pb.h files that are generated |
| 64 | export_proto_headers: true, |
| 65 | }, |
| 66 | srcs: ["icing/**/*.proto"], |
| 67 | } |
| 68 | |
| 69 | cc_library_shared { |
| 70 | name: "libicing_jni", |
| 71 | defaults: ["libicing_defaults"], |
| 72 | srcs: [ |
| 73 | "icing/**/*.cc", |
| 74 | ], |
| 75 | exclude_srcs: [ |
| 76 | // Tests |
| 77 | "icing/**/*_test.cc", |
| 78 | // Benchmarks |
| 79 | "icing/**/*_benchmark.cc", |
| 80 | // Test-only related files (i.e. utils) |
| 81 | "icing/testing/**/*", |
| 82 | // Tools for manual debugging/investigating |
| 83 | "icing/tools/**/*", |
| 84 | ], |
| 85 | static_libs: [ |
| 86 | "icing-c-proto", |
| 87 | "libutf", |
| 88 | ], |
| 89 | shared_libs: [ |
| 90 | "libandroidicu", |
| 91 | "liblog", |
| 92 | // TODO(b/147509515): We only need the full version for GzipStream. If we can remove |
| 93 | // that dependency, then we can just use libprotobuf-cpp-lite |
| 94 | "libprotobuf-cpp-full", |
| 95 | "libz", |
| 96 | ], |
| 97 | |
| 98 | version_script: "icing/jni.lds", |
| 99 | } |
| 100 | |
| 101 | // TODO(cassiewang): Add build rules and a TEST_MAPPING for cc_tests |