1/* 2 * Copyright 2017 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 24cc_defaults { 25 name: "neuralnetworks_utils_defaults", 26 defaults: ["neuralnetworks_defaults"], 27 host_supported: true, 28 vendor_available: true, 29 apex_available: [ 30 "//apex_available:platform", 31 "com.android.neuralnetworks", 32 "test_com.android.neuralnetworks", 33 ], 34 min_sdk_version: "30", 35 target: { 36 host: { 37 cflags: [ 38 "-D__ANDROID_API_S__=31", 39 ], 40 }, 41 }, 42} 43 44cc_library_headers { 45 name: "neuralnetworks_types_headers", 46 host_supported: true, 47 export_include_dirs: ["include"], 48} 49 50cc_defaults { 51 name: "neuralnetworks_types_defaults", 52 defaults: ["neuralnetworks_utils_defaults"], 53 srcs: [ 54 "operations/src/*.cpp", 55 "src/OperationsUtils.cpp", 56 "src/OperationsValidationUtils.cpp", 57 "src/SharedMemory.cpp", 58 "src/SharedMemoryAndroid.cpp", 59 "src/TypeUtils.cpp", 60 "src/Types.cpp", 61 "src/Validation.cpp", 62 ], 63 target: { 64 android: { 65 shared_libs: [ 66 "libnativewindow", 67 ], 68 static_libs: ["libarect"], 69 }, 70 }, 71 local_include_dirs: [ 72 "include/nnapi", 73 "operations/include", 74 ], 75 export_include_dirs: ["include"], 76 shared_libs: [ 77 "libbase", 78 "libcutils", 79 "libutils", 80 ], 81 export_shared_lib_headers: [ 82 "libbase", 83 "libcutils", 84 "libutils", 85 ], 86} 87 88cc_library_static { 89 name: "neuralnetworks_types", 90 defaults: ["neuralnetworks_types_defaults"], 91} 92 93cc_library_static { 94 name: "neuralnetworks_types_experimental", 95 defaults: ["neuralnetworks_types_defaults"], 96 cflags: ["-DNN_EXPERIMENTAL_FEATURE"], 97} 98 99cc_library_static { 100 name: "neuralnetworks_types_cl", 101 host_supported: false, 102 defaults: [ 103 "neuralnetworks_cl_defaults", 104 "neuralnetworks_utils_defaults", 105 ], 106 srcs: [ 107 "operations/src/*.cpp", 108 "src/DynamicCLDeps.cpp", 109 "src/OperationsUtils.cpp", 110 "src/OperationsValidationUtils.cpp", 111 "src/SharedMemory.cpp", 112 "src/SharedMemoryAndroid.cpp", 113 "src/TypeUtils.cpp", 114 "src/Types.cpp", 115 "src/Validation.cpp", 116 ], 117 local_include_dirs: [ 118 "include/nnapi", 119 "operations/include", 120 ], 121 export_include_dirs: ["include"], 122 static_libs: [ 123 "libbase_ndk", 124 ], 125 export_static_lib_headers: [ 126 "libbase_ndk", 127 ], 128 shared_libs: [ 129 "libandroid", 130 ], 131} 132