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 15 cc_library_headers { 16 name: "jni_headers", 17 host_supported: true, 18 export_include_dirs: ["include_jni"], 19 vendor_available: true, 20 } 21 22 cc_library { 23 name: "libnativehelper", 24 host_supported: true, 25 srcs: [ 26 "JNIHelp.cpp", 27 "JniConstants.cpp", 28 "toStringArray.cpp", 29 "JniInvocation.cpp", 30 ], 31 32 target: { 33 android: { 34 srcs: ["AsynchronousCloseMonitor.cpp"], 35 shared_libs: ["libdl"], 36 }, 37 linux: { 38 srcs: ["AsynchronousCloseMonitor.cpp"], 39 host_ldlibs: ["-ldl"], 40 }, 41 }, 42 43 header_libs: ["jni_headers"], 44 export_header_lib_headers: ["jni_headers"], 45 46 shared_libs: [ 47 "liblog", 48 ], 49 clang: true, 50 cflags: [ 51 "-Werror", 52 "-fvisibility=protected", 53 ], 54 55 export_include_dirs: ["include", "platform_include"], 56 } 57 58 // 59 // NDK-only build for the target (device), using libc++. 60 // - Relies only on NDK exposed functionality. 61 // - This doesn't include JniInvocation. 62 // 63 64 cc_library_shared { 65 name: "libnativehelper_compat_libc++", 66 clang: true, 67 local_include_dirs: ["include/nativehelper"], 68 export_include_dirs: ["include/nativehelper"], 69 cflags: ["-Werror"], 70 srcs: [ 71 "JNIHelp.cpp", 72 "JniConstants.cpp", 73 "toStringArray.cpp", 74 ], 75 shared_libs: [ 76 "liblog", 77 "libdl", 78 ], 79 sdk_version: "19", 80 stl: "c++_static", 81 } 82 83 ndk_headers { 84 name: "ndk_jni.h", 85 from: "include_jni", 86 to: "", 87 srcs: ["include_jni/jni.h"], 88 license: "NOTICE", 89 } 90 91 // 92 // Tests. 93 // 94 95 subdirs = ["tests"] 96