1/*
2 * Copyright 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // the below license kinds from "test_mlts_benchmark_license":
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["test_mlts_benchmark_license"],
23}
24
25cc_defaults {
26    name: "libnnbenchmark_jni_defaults",
27    sdk_version: "current",
28    min_sdk_version: "29",
29    srcs: [
30        "benchmark_jni.cpp",
31        "crashtest_jni.cpp",
32        "run_tflite.cpp",
33    ],
34    header_libs: [
35        "flatbuffer_headers",
36        "jni_headers",
37        "tensorflow_headers",
38    ],
39    shared_libs: [
40        "liblog",
41    ],
42    static_libs: [
43        "libtflite_static",
44    ],
45    cflags: [
46        "-Wno-sign-compare",
47        "-Wno-unused-parameter",
48    ],
49    stl: "libc++_static",
50    strip: {
51        keep_symbols: true,
52    },
53}
54
55cc_library_shared {
56    name: "libnnbenchmark_jni",
57    defaults: ["libnnbenchmark_jni_defaults"],
58}
59
60cc_library_static {
61    name: "libnnbenchmark_jni_static",
62    defaults: ["libnnbenchmark_jni_defaults"],
63    export_include_dirs: ["."],
64}
65
66cc_library {
67    name: "librandom_graph_test_jni",
68    srcs: [
69        "random_graph_test_jni.cpp",
70    ],
71    header_libs: [
72        "jni_headers",
73        "libneuralnetworks_headers_ndk",
74        "libneuralnetworks_generated_test_harness_headers_for_cts",
75    ],
76    shared_libs: [
77        "libandroid",
78        "liblog",
79        "libneuralnetworks",
80    ],
81    whole_static_libs: [
82        "NeuralNetworksTest_random_graph",
83    ],
84    static_libs: [
85        "libbase_ndk",
86        "libgmock_ndk",
87        "libgtest_ndk_c++",
88    ],
89    cflags: [
90        "-Wno-sign-compare",
91        "-Wno-unused-parameter",
92    ],
93    sdk_version: "current",
94    stl: "libc++_static",
95    strip: {
96        keep_symbols: true,
97    },
98}
99
100cc_library {
101    name: "libsupport_library_jni",
102    sdk_version: "current",
103    min_sdk_version: "29",
104    srcs: [
105        "support_library_jni.cpp",
106    ],
107    header_libs: [
108        "flatbuffer_headers",
109        "jni_headers",
110        "tensorflow_headers",
111    ],
112    shared_libs: [
113        "liblog",
114    ],
115    static_libs: [
116        "libtflite_static",
117    ],
118    cflags: [
119        "-Wno-sign-compare",
120        "-Wno-unused-parameter",
121    ],
122    stl: "libc++_static",
123    strip: {
124        keep_symbols: true,
125    },
126}
127