• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright 2021 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    // Inherits all licenses from parent to get Apache 2.0 and package name
19    default_applicable_licenses: [
20        "packages_modules_NeuralNetworks_license",
21    ],
22}
23
24// Prebuilt generated using 'generated_prebuilts.sh'
25cc_prebuilt_library_shared {
26    name: "neuralnetworks_sample_sl_driver_prebuilt",
27
28    host_supported: false,
29    shared_libs: [
30        "libbase",
31        "libcutils",
32        "liblog",
33        "libnativewindow",
34    ],
35    proprietary: true,
36    vendor: true,
37    // libnativewindow versioning trips this check. b/181227567 for fixing
38    allow_undefined_symbols: true,
39    target: {
40        android_x86_64: {
41            srcs: ["android_x86_64/neuralnetworks_sample_sl_driver_prebuilt.so"],
42        },
43        android_x86: {
44            srcs: ["android_x86/neuralnetworks_sample_sl_driver_prebuilt.so"],
45        },
46        android_arm64: {
47            srcs: ["android_arm64/neuralnetworks_sample_sl_driver_prebuilt.so"],
48        },
49        android_arm: {
50            srcs: ["android_arm/neuralnetworks_sample_sl_driver_prebuilt.so"],
51        },
52        android_riscv64: {
53            srcs: ["android_riscv64/neuralnetworks_sample_sl_driver_prebuilt.so"],
54        },
55    },
56    apex_available: ["//apex_available:platform"],
57}
58
59cc_defaults {
60    name: "NeuralNetworksShimDriverAidl_defaults",
61    host_supported: false,
62    defaults: [
63        "neuralnetworks_defaults",
64        "neuralnetworks_use_latest_utils_hal_aidl",
65    ],
66    header_libs: [
67        "libneuralnetworks_headers",
68    ],
69    cflags: [
70        "-DNN_COMPATIBILITY_LIBRARY_BUILD",
71    ],
72    ldflags: [
73        // neuralnetworks_sample_sl_driver_prebuilt has undefined symbols that
74        // cause linker failures with --no-allow-shlib-undefined, the default
75        // when linking executables.
76        "-Wl,--allow-shlib-undefined",
77    ],
78    static_libs: [
79        "libaidlcommonsupport",
80        "libarect",
81        "libcutils",
82        "libneuralnetworks_common",
83        "libneuralnetworks_shim_static",
84        "neuralnetworks_supportlibrary_loader",
85        "neuralnetworks_utils_hal_common",
86    ],
87    shared_libs: [
88        "libbase",
89        "libbinder_ndk",
90        "libhidlbase",
91        "libhidlmemory",
92        "liblog",
93        "libnativewindow",
94        "libutils",
95        "neuralnetworks_sample_sl_driver_prebuilt",
96    ],
97
98}
99
100cc_defaults {
101    name: "NeuralNetworksShimDriverAidl_server_defaults",
102    defaults: ["NeuralNetworksShimDriverAidl_defaults"],
103    relative_install_path: "hw",
104    proprietary: true,
105}
106
107// android.hardware.neuralnetworks-shim-service-sample takes an existing Support
108// Library prebuilt object and registers it as a sAIDL vendor service.
109//
110// To see an example where the driver code is available as a vendor service
111// directly in the build system, refer to how the sAIDL adapter is used in
112// android.hardware.neuralnetworks-service-sample-limited in the file
113// packages/modules/NeuralNetworks/driver/sample_aidl/Android.bp.
114cc_binary {
115    name: "android.hardware.neuralnetworks-shim-service-sample",
116    srcs: ["ShimServiceSample.cpp"],
117    defaults: ["NeuralNetworksShimDriverAidl_server_defaults"],
118    stl: "libc++_static",
119    init_rc: ["config/android.hardware.neuralnetworks-shim-service-sample.rc"],
120    vintf_fragments: ["config/android.hardware.neuralnetworks-shim-service-sample.xml"],
121}
122