/* * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package { // Inherits all licenses from parent to get Apache 2.0 and package name default_applicable_licenses: [ "packages_modules_NeuralNetworks_license", ], } cc_defaults { name: "NeuralNetworksSampleDriverAidl_defaults", defaults: [ "neuralnetworks_defaults", "neuralnetworks_use_latest_utils_hal_aidl", ], host_supported: false, // b/109953668, disable OpenMP // openmp: true, srcs: [ "SampleDriverAidl.cpp", "SampleDriverAidlFull.cpp", "SampleDriverAidlPartial.cpp", "SampleDriverAidlUtils.cpp", ], header_libs: [ "libneuralnetworks_headers", ], shared_libs: [ "android.hardware.neuralnetworks@1.0", "android.hardware.neuralnetworks@1.1", "android.hardware.neuralnetworks@1.2", "android.hardware.neuralnetworks@1.3", "libbase", "libbinder_ndk", "libcutils", "libdl", "libfmq", "libhardware", "libhidlbase", "libhidlmemory", "liblog", "libnativewindow", "libtextclassifier_hash", "libutils", ], static_libs: [ "libaidlcommonsupport", "libneuralnetworks_common", "neuralnetworks_utils_hal_common", ], } cc_defaults { name: "NeuralNetworksSampleDriverAidl_server_defaults", defaults: ["NeuralNetworksSampleDriverAidl_defaults"], relative_install_path: "hw", proprietary: true, } cc_binary { name: "android.hardware.neuralnetworks-service-sample-all", srcs: ["SampleDriverAidlAll.cpp"], defaults: ["NeuralNetworksSampleDriverAidl_server_defaults"], init_rc: ["config/android.hardware.neuralnetworks-service-sample-all.rc"], vintf_fragments: ["config/android.hardware.neuralnetworks-service-sample-all.xml"], } // android.hardware.neuralnetworks-service-sample-limited is a sAIDL vendor // service that adapts multiple canonical interface objects (as returned by // `getDevices`) as sAIDL objects and registers them with service manager. // Because it is vendor_available, it cannot use the Support Library's _cl // build variants. Instead, it uses the non-_cl variants which are // vendor_available, including: // * neuralnetworks_types // * libneuralnetworks_common // * neuralnetworks_utils_hal_adapter_aidl // // To see how the Support Library object can be built, refer to // neuralnetworks_sample_sl_driver defined in // packages/modules/NeuralNetworks/driver/sample/Android.bp. // // To see how a Support Library prebuilt can be used as a sAIDL vendor service, // refer to android.hardware.neuralnetworks-shim-service-sample defined in // packages/modules/NeuralNetworks/driver/sample_shim/Android.bp. cc_binary { name: "android.hardware.neuralnetworks-service-sample-limited", srcs: ["SampleDriverAidlLimited.cpp"], defaults: [ "neuralnetworks_defaults", "neuralnetworks_use_latest_utils_hal_aidl", ], header_libs: [ "libneuralnetworks_headers", ], shared_libs: [ "libbase", "libbinder_ndk", "libcutils", "liblog", "libnativewindow", "libtextclassifier_hash", "libutils", ], static_libs: [ "libaidlcommonsupport", "libneuralnetworks_common", "neuralnetworks_canonical_sample_driver", "neuralnetworks_utils_hal_adapter_aidl", ], relative_install_path: "hw", proprietary: true, init_rc: ["config/android.hardware.neuralnetworks-service-sample-limited.rc"], vintf_fragments: ["config/android.hardware.neuralnetworks-service-sample-limited.xml"], } cc_library_static { name: "libSampleDriverAidl", defaults: ["NeuralNetworksSampleDriverAidl_defaults"], export_include_dirs: ["."], }