blob: 10c0ff6e6159f87b933919916a47d7abfe594215 [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,
Victor Khimenkofd6b1132020-09-03 01:22:31 +020020 native_bridge_supported: true,
Jerome Gaillardf0d42052019-03-12 15:17:22 +000021 target: {
22 windows: {
23 enabled: true,
24 },
25 },
Paul Duffin2419dfa2019-07-16 19:46:21 +010026 // The minimum sdk version required by users of this module.
27 sdk_version: "minimum",
Jooyung Hane01d3022020-04-16 18:48:33 +090028 // As part of mainline modules(APEX), it should support at least 29(Q)
29 min_sdk_version: "29",
Jiyong Park083b9202017-07-14 15:56:33 +090030}
31
Andreas Gampe12afda42017-08-23 11:26:30 -070032cc_library_headers {
Andreas Gamped299c072017-10-17 10:50:00 -070033 name: "libnativehelper_header_only",
34 host_supported: true,
35 export_include_dirs: ["header_only_include"],
Jerome Gaillardf0d42052019-03-12 15:17:22 +000036 target: {
37 windows: {
38 enabled: true,
39 },
40 },
Paul Duffin22612b42019-07-16 15:25:32 +010041 sdk_version: "current",
Jooyung Hane01d3022020-04-16 18:48:33 +090042 // As part of mainline modules(APEX), it should support at least 29(Q)
43 min_sdk_version: "29",
Jiyong Parkad9fce12020-04-28 18:22:19 +090044
45 apex_available: [
46 "//apex_available:platform",
Orion Hodson24c47512020-05-29 13:34:15 +010047 "//apex_available:anyapex",
Jiyong Parkad9fce12020-04-28 18:22:19 +090048 ],
Andreas Gamped299c072017-10-17 10:50:00 -070049}
50
51cc_library_headers {
Andreas Gampe12afda42017-08-23 11:26:30 -070052 name: "jni_platform_headers",
53 host_supported: true,
54 export_include_dirs: ["platform_include"],
Jerome Gaillardf0d42052019-03-12 15:17:22 +000055 target: {
56 windows: {
57 enabled: true,
58 },
59 },
Jiyong Parkad9fce12020-04-28 18:22:19 +090060
61 apex_available: [
62 "//apex_available:platform",
63 "com.android.art.debug",
64 "com.android.art.release",
65 ],
Andreas Gampe12afda42017-08-23 11:26:30 -070066}
67
Martin Stjernholm8f6839c2019-02-05 15:06:45 +000068cc_library {
69 name: "libnativehelper",
Colin Crosscf47d9b2016-07-27 10:35:53 -070070 host_supported: true,
71 srcs: [
72 "JNIHelp.cpp",
73 "JniConstants.cpp",
Colin Crosscf47d9b2016-07-27 10:35:53 -070074 "JniInvocation.cpp",
Orion Hodsonaadb3732018-11-21 12:58:34 +000075 "toStringArray.cpp",
Colin Crosscf47d9b2016-07-27 10:35:53 -070076 ],
Orion Hodsona7599ac2020-02-04 11:26:36 +000077 shared_libs: ["liblog"],
Colin Crosscf47d9b2016-07-27 10:35:53 -070078 cflags: [
79 "-Werror",
80 "-fvisibility=protected",
81 ],
Orion Hodsonb01e7fe2018-11-07 06:07:50 +000082 export_include_dirs: [
Martin Stjernholm8f6839c2019-02-05 15:06:45 +000083 "include",
84 "header_only_include",
Paul Duffine3cee242019-07-16 20:03:03 +010085 "platform_include",
Orion Hodsonb01e7fe2018-11-07 06:07:50 +000086 ],
Martin Stjernholm8f6839c2019-02-05 15:06:45 +000087 stubs: {
88 symbol_file: "libnativehelper.map.txt",
89 versions: ["1"],
90 },
Jerome Gaillardf0d42052019-03-12 15:17:22 +000091 target: {
92 windows: {
Orion Hodsona7599ac2020-02-04 11:26:36 +000093 shared_libs: ["libbase"],
Jerome Gaillardf0d42052019-03-12 15:17:22 +000094 enabled: true,
95 },
96 },
Orion Hodson24c47512020-05-29 13:34:15 +010097 // Please avoid adding APEX dependencies on this for R (b/157711673).
Jiyong Park694bb952019-12-19 02:12:22 +000098 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",
Jiyong Park84654d72020-02-02 21:13:59 +0900104 // b/133140750 Clean this up, or allow this library to everywhere
105 "com.android.bluetooth.updatable",
Jiyong Park694bb952019-12-19 02:12:22 +0000106 ],
Colin Crosscf47d9b2016-07-27 10:35:53 -0700107}
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++",
Steven Moreland3544a932017-07-19 10:26:05 -0700117 export_include_dirs: [
Andreas Gamped299c072017-10-17 10:50:00 -0700118 "header_only_include",
Steven Moreland3544a932017-07-19 10:26:05 -0700119 "include",
Steven Moreland3544a932017-07-19 10:26:05 -0700120 ],
Colin Crosscf47d9b2016-07-27 10:35:53 -0700121 cflags: ["-Werror"],
Paul Duffin224f2e42019-07-16 15:26:42 +0100122 local_include_dirs: [
123 "header_only_include",
124 "platform_include",
Andreas Gamped299c072017-10-17 10:50:00 -0700125 ],
Colin Crosscf47d9b2016-07-27 10:35:53 -0700126 srcs: [
127 "JNIHelp.cpp",
128 "JniConstants.cpp",
129 "toStringArray.cpp",
130 ],
131 shared_libs: [
132 "liblog",
Colin Crosscf47d9b2016-07-27 10:35:53 -0700133 ],
134 sdk_version: "19",
135 stl: "c++_static",
136}
137
Dan Albert3cada472016-07-27 12:44:35 -0700138ndk_headers {
139 name: "ndk_jni.h",
Steven Morelandab365e32017-07-18 13:24:41 -0700140 from: "include_jni",
Dan Albert3cada472016-07-27 12:44:35 -0700141 to: "",
Steven Morelandab365e32017-07-18 13:24:41 -0700142 srcs: ["include_jni/jni.h"],
Dan Alberta725dc62016-10-20 10:17:46 -0700143 license: "NOTICE",
Dan Albert3cada472016-07-27 12:44:35 -0700144}
145
Colin Crosscf47d9b2016-07-27 10:35:53 -0700146//
147// Tests.
148//
149
150subdirs = ["tests"]