1// Copyright (C) 2009 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15cc_library_headers { 16 name: "jni_headers", 17 host_supported: true, 18 export_include_dirs: ["include_jni"], 19 vendor_available: true, 20 native_bridge_supported: true, 21 target: { 22 windows: { 23 enabled: true, 24 }, 25 }, 26 // The minimum sdk version required by users of this module. 27 sdk_version: "minimum", 28 // As part of mainline modules(APEX), it should support at least 29(Q) 29 min_sdk_version: "29", 30} 31 32cc_library_headers { 33 name: "libnativehelper_header_only", 34 host_supported: true, 35 export_include_dirs: ["header_only_include"], 36 target: { 37 windows: { 38 enabled: true, 39 }, 40 }, 41 sdk_version: "current", 42 // As part of mainline modules(APEX), it should support at least 29(Q) 43 min_sdk_version: "29", 44 45 apex_available: [ 46 "//apex_available:platform", 47 "//apex_available:anyapex", 48 ], 49} 50 51cc_library_headers { 52 name: "jni_platform_headers", 53 host_supported: true, 54 export_include_dirs: ["platform_include"], 55 target: { 56 windows: { 57 enabled: true, 58 }, 59 }, 60 61 apex_available: [ 62 "//apex_available:platform", 63 "com.android.art.debug", 64 "com.android.art.release", 65 ], 66} 67 68cc_library { 69 name: "libnativehelper", 70 host_supported: true, 71 srcs: [ 72 "JNIHelp.cpp", 73 "JniConstants.cpp", 74 "JniInvocation.cpp", 75 "toStringArray.cpp", 76 ], 77 shared_libs: ["liblog"], 78 cflags: [ 79 "-Werror", 80 "-fvisibility=protected", 81 ], 82 export_include_dirs: [ 83 "include", 84 "header_only_include", 85 "platform_include", 86 ], 87 stubs: { 88 symbol_file: "libnativehelper.map.txt", 89 versions: ["1"], 90 }, 91 target: { 92 windows: { 93 shared_libs: ["libbase"], 94 enabled: true, 95 }, 96 }, 97 // Please avoid adding APEX dependencies on this for R (b/157711673). 98 apex_available: [ 99 "com.android.art.release", 100 "com.android.art.debug", 101 // b/133140750 Clean this up. This is due to the dependency from libplatform_library_jni, 102 // librs_jni, libjni_legacymosaic, etc. 103 "//apex_available:platform", 104 // b/133140750 Clean this up, or allow this library to everywhere 105 "com.android.bluetooth.updatable", 106 ], 107} 108 109// 110// NDK-only build for the target (device), using libc++. 111// - Relies only on NDK exposed functionality. 112// - This doesn't include JniInvocation. 113// 114 115cc_library_shared { 116 name: "libnativehelper_compat_libc++", 117 export_include_dirs: [ 118 "header_only_include", 119 "include", 120 ], 121 cflags: ["-Werror"], 122 local_include_dirs: [ 123 "header_only_include", 124 "platform_include", 125 ], 126 srcs: [ 127 "JNIHelp.cpp", 128 "JniConstants.cpp", 129 "toStringArray.cpp", 130 ], 131 shared_libs: [ 132 "liblog", 133 ], 134 sdk_version: "19", 135 stl: "c++_static", 136} 137 138ndk_headers { 139 name: "ndk_jni.h", 140 from: "include_jni", 141 to: "", 142 srcs: ["include_jni/jni.h"], 143 license: "NOTICE", 144} 145 146// 147// Tests. 148// 149 150subdirs = ["tests"] 151