blob: 038baa50dba961563891d81cb99eb56425b9269e [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
Colin Crosscf47d9b2016-07-27 10:35:53 -070022cc_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 },
Jiyong Park083b9202017-07-14 15:56:33 +090041 },
42
43 header_libs: ["jni_headers"],
44 export_header_lib_headers: ["jni_headers"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070045
46 shared_libs: [
47 "liblog",
48 ],
49 clang: true,
50 cflags: [
51 "-Werror",
52 "-fvisibility=protected",
53 ],
Jiyong Park083b9202017-07-14 15:56:33 +090054
Igor Murashkin31927e42017-02-17 15:50:15 -080055 export_include_dirs: ["include", "platform_include"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070056}
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
64cc_library_shared {
65 name: "libnativehelper_compat_libc++",
66 clang: true,
Steven Moreland3544a932017-07-19 10:26:05 -070067 export_include_dirs: [
68 "include",
69 "include/nativehelper", // TODO(b/63762847): remove
70 ],
Colin Crosscf47d9b2016-07-27 10:35:53 -070071 cflags: ["-Werror"],
72 srcs: [
73 "JNIHelp.cpp",
74 "JniConstants.cpp",
75 "toStringArray.cpp",
76 ],
77 shared_libs: [
78 "liblog",
79 "libdl",
80 ],
81 sdk_version: "19",
82 stl: "c++_static",
83}
84
Dan Albert3cada472016-07-27 12:44:35 -070085ndk_headers {
86 name: "ndk_jni.h",
Steven Morelandab365e32017-07-18 13:24:41 -070087 from: "include_jni",
Dan Albert3cada472016-07-27 12:44:35 -070088 to: "",
Steven Morelandab365e32017-07-18 13:24:41 -070089 srcs: ["include_jni/jni.h"],
Dan Alberta725dc62016-10-20 10:17:46 -070090 license: "NOTICE",
Dan Albert3cada472016-07-27 12:44:35 -070091}
92
Colin Crosscf47d9b2016-07-27 10:35:53 -070093//
94// Tests.
95//
96
97subdirs = ["tests"]