aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCassie Wang <cassiewang@google.com>2020-01-09 14:16:43 -0800
committerCassie Wang <cassiewang@google.com>2020-01-14 17:09:04 -0800
commit871e67753cf4bfeba09fc73b972ffe59ab1159b4 (patch)
treedd10bb787442f54d210ccff7a3162cd035682a8e
parent3916d68580949af407fc82dc796c717155fcdd56 (diff)
downloadicing-871e67753cf4bfeba09fc73b972ffe59ab1159b4.tar.gz
Modify Android.bp to compile c++ code.
Bug: 146383629 Test: manual - ran 'm -j libicing' Change-Id: I0be3d1e088f0f2e07f027c4f66a7ed27f6d6f880
-rw-r--r--Android.bp72
1 files changed, 72 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index 78f0b17..f54b066 100644
--- a/Android.bp
+++ b/Android.bp
@@ -25,3 +25,75 @@ java_library {
jarjar_rules: "jarjar-rules.txt",
sdk_version: "core_current",
}
+
+cc_defaults {
+ name: "libicing_defaults",
+
+ // For debug / treemap purposes.
+ //strip: {
+ // keep_symbols: true,
+ //},
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ "-Wno-deprecated-declarations",
+ "-Wno-ignored-qualifiers",
+ "-Wno-missing-field-initializers",
+ "-Wno-sign-compare",
+ "-Wno-tautological-constant-out-of-range-compare",
+ "-Wno-undefined-var-template",
+ "-Wno-unused-function",
+ "-Wno-unused-parameter",
+ "-Wno-extern-c-compat",
+
+ "-funsigned-char",
+ "-fvisibility=hidden",
+ ],
+}
+
+cc_library_static {
+ name: "libicing_proto_lite",
+ defaults: ["libicing_defaults"],
+ proto: {
+ type: "lite",
+ // Find protos relative from where they're specified (useful for external protos)
+ canonical_path_from_root: false,
+ // Need to be able to see the .pb.h files that are generated
+ export_proto_headers: true,
+ },
+ srcs: ["icing/**/*.proto"],
+}
+
+cc_library_shared {
+ name: "libicing",
+ defaults: ["libicing_defaults"],
+ srcs: [
+ "icing/**/*.cc",
+ ],
+ exclude_srcs: [
+ // Tests
+ "icing/**/*_test.cc",
+ // Benchmarks
+ "icing/**/*_benchmark.cc",
+ // Test-only related files (i.e. utils)
+ "icing/testing/**/*",
+ // Tools for manual debugging/investigating
+ "icing/tools/**/*",
+ ],
+ static_libs: [
+ "libicing_proto_lite",
+ "libutf",
+ ],
+ shared_libs: [
+ "libandroidicu",
+ "liblog",
+ // TODO(b/147509515): We only need the full version for GzipStream. If we can remove
+ // that dependency, then we can just use libprotobuf-cpp-lite
+ "libprotobuf-cpp-full",
+ "libz",
+ ],
+}
+
+// TODO(cassiewang): Add build rules and a TEST_MAPPING for cc_tests