blob: b79999f5248a837ec16e834e016da725cb5b9442 [file] [log] [blame]
Colin Crosscf47d9b2016-07-27 10:35:53 -07001// 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
Jiyong Park083b9202017-07-14 15:56:33 +090015cc_library_headers {
16 name: "jni_headers",
17 host_supported: true,
18 export_include_dirs: ["include_jni"],
19 vendor_available: true,
20}
21
Andreas Gampe12afda42017-08-23 11:26:30 -070022cc_library_headers {
23 name: "jni_platform_headers",
24 host_supported: true,
25 export_include_dirs: ["platform_include"],
26}
27
Colin Crosscf47d9b2016-07-27 10:35:53 -070028cc_library {
29 name: "libnativehelper",
30 host_supported: true,
31 srcs: [
32 "JNIHelp.cpp",
33 "JniConstants.cpp",
34 "toStringArray.cpp",
35 "JniInvocation.cpp",
36 ],
37
38 target: {
39 android: {
40 srcs: ["AsynchronousCloseMonitor.cpp"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070041 },
Dan Willemsen5d13cf02017-10-02 10:41:10 -070042 linux_glibc: {
Colin Crosscf47d9b2016-07-27 10:35:53 -070043 srcs: ["AsynchronousCloseMonitor.cpp"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070044 },
Jiyong Park083b9202017-07-14 15:56:33 +090045 },
46
Logan Chien63e49172016-06-08 11:33:36 +080047 header_libs: ["jni_headers", "jni_platform_headers"],
Jiyong Park083b9202017-07-14 15:56:33 +090048 export_header_lib_headers: ["jni_headers"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070049
50 shared_libs: [
51 "liblog",
52 ],
Colin Crosscf47d9b2016-07-27 10:35:53 -070053 cflags: [
54 "-Werror",
55 "-fvisibility=protected",
56 ],
Jiyong Park083b9202017-07-14 15:56:33 +090057
Igor Murashkin31927e42017-02-17 15:50:15 -080058 export_include_dirs: ["include", "platform_include"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070059}
60
61//
62// NDK-only build for the target (device), using libc++.
63// - Relies only on NDK exposed functionality.
64// - This doesn't include JniInvocation.
65//
66
67cc_library_shared {
68 name: "libnativehelper_compat_libc++",
Steven Moreland3544a932017-07-19 10:26:05 -070069 export_include_dirs: [
70 "include",
71 "include/nativehelper", // TODO(b/63762847): remove
72 ],
Colin Crosscf47d9b2016-07-27 10:35:53 -070073 cflags: ["-Werror"],
Logan Chien63e49172016-06-08 11:33:36 +080074 include_dirs: ["libnativehelper/platform_include"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070075 srcs: [
76 "JNIHelp.cpp",
77 "JniConstants.cpp",
78 "toStringArray.cpp",
79 ],
80 shared_libs: [
81 "liblog",
82 "libdl",
83 ],
84 sdk_version: "19",
85 stl: "c++_static",
86}
87
Dan Albert3cada472016-07-27 12:44:35 -070088ndk_headers {
89 name: "ndk_jni.h",
Steven Morelandab365e32017-07-18 13:24:41 -070090 from: "include_jni",
Dan Albert3cada472016-07-27 12:44:35 -070091 to: "",
Steven Morelandab365e32017-07-18 13:24:41 -070092 srcs: ["include_jni/jni.h"],
Dan Alberta725dc62016-10-20 10:17:46 -070093 license: "NOTICE",
Dan Albert3cada472016-07-27 12:44:35 -070094}
95
Colin Crosscf47d9b2016-07-27 10:35:53 -070096//
97// Tests.
98//
99
100subdirs = ["tests"]