blob: 316c0874530fd3287a7b99192b6bd56cd76e6dd6 [file] [log] [blame]
Orion Hodson9b16e342019-10-09 13:29:16 +01001// Shared library for target
2// ========================================================
Bob Badour9150de62021-02-26 03:22:24 -08003package {
4 // See: http://go/android-license-faq
5 // A large-scale-change added 'default_applicable_licenses' to import
6 // all of the 'license_kinds' from "art_license"
7 // to get the below license kinds:
8 // SPDX-license-identifier-Apache-2.0
9 default_applicable_licenses: ["art_license"],
10}
11
Orion Hodson9b16e342019-10-09 13:29:16 +010012cc_defaults {
13 name: "libnativeloader-defaults",
Martin Stjernholm3bb009a2019-10-17 21:29:01 +010014 defaults: ["art_defaults"],
Orion Hodson9b16e342019-10-09 13:29:16 +010015 cppflags: [
16 "-fvisibility=hidden",
17 ],
18 header_libs: ["libnativeloader-headers"],
19 export_header_lib_headers: ["libnativeloader-headers"],
20}
21
David Srbecky1cf46a32020-06-22 15:39:00 +010022art_cc_library {
Orion Hodson9b16e342019-10-09 13:29:16 +010023 name: "libnativeloader",
24 defaults: ["libnativeloader-defaults"],
Orion Hodsonc78860b2019-10-11 11:30:01 +010025 visibility: [
Orion Hodsonc78860b2019-10-11 11:30:01 +010026 "//frameworks/base/cmds/app_process",
Martin Stjernholm3bb009a2019-10-17 21:29:01 +010027 // TODO(b/133140750): Clean this up.
Orion Hodsonc78860b2019-10-11 11:30:01 +010028 "//frameworks/base/native/webview/loader",
29 ],
Jiyong Park066dd9022019-12-19 02:11:59 +000030 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010031 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +000032 "com.android.art.debug",
33 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010034 host_supported: true,
35 srcs: [
36 "native_loader.cpp",
37 ],
Orion Hodson00cb81d2020-04-03 06:47:07 +010038 header_libs: [
39 "libnativehelper_header_only",
40 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010041 shared_libs: [
Orion Hodson9b16e342019-10-09 13:29:16 +010042 "liblog",
43 "libnativebridge",
44 "libbase",
45 ],
46 target: {
David Srbeckyc4b50b32020-07-01 15:10:23 +010047 // Library search path needed for running host tests remotely (from testcases directory).
48 linux_glibc_x86: {
49 ldflags: [
50 "-Wl,-rpath,$ORIGIN/../art_common/out/host/linux-x86/lib",
51 "-Wl,--enable-new-dtags",
52 ],
53 },
54 linux_glibc_x86_64: {
55 ldflags: [
56 "-Wl,-rpath,$ORIGIN/../art_common/out/host/linux-x86/lib64",
57 "-Wl,--enable-new-dtags",
58 ],
59 },
Orion Hodson9b16e342019-10-09 13:29:16 +010060 android: {
61 srcs: [
62 "library_namespaces.cpp",
63 "native_loader_namespace.cpp",
64 "public_libraries.cpp",
65 ],
66 shared_libs: [
67 "libdl_android",
68 ],
Martin Stjernholm2b84cf82021-01-28 22:54:14 +000069 static_libs: [
Justin Yun3db26d52019-12-16 14:09:39 +090070 "PlatformProperties",
71 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010072 },
73 },
Orion Hodson9b16e342019-10-09 13:29:16 +010074 stubs: {
75 symbol_file: "libnativeloader.map.txt",
76 versions: ["1"],
77 },
78}
79
80// TODO(b/124250621) eliminate the need for this library
81cc_library {
82 name: "libnativeloader_lazy",
83 defaults: ["libnativeloader-defaults"],
Orion Hodsonc78860b2019-10-11 11:30:01 +010084 visibility: [
85 "//frameworks/base/core/jni",
86 "//frameworks/native/opengl/libs",
87 "//frameworks/native/vulkan/libvulkan",
88 ],
Martin Stjernholmb5ed3302020-10-30 02:27:23 +000089 apex_available: [
90 "//apex_available:platform",
Martin Stjernholm694f0122020-10-30 02:23:24 +000091 "com.android.media",
92 "com.android.media.swcodec",
Martin Stjernholmb5ed3302020-10-30 02:27:23 +000093 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010094 host_supported: false,
95 srcs: ["native_loader_lazy.cpp"],
Martin Stjernholmb5ed3302020-10-30 02:27:23 +000096 runtime_libs: ["libnativeloader"],
Mitch Phillips5472d6f2020-07-01 09:43:16 -070097 shared_libs: ["liblog"],
Orion Hodson9b16e342019-10-09 13:29:16 +010098}
99
100cc_library_headers {
101 name: "libnativeloader-headers",
Jiyong Park71f661c2020-04-28 18:20:43 +0900102 apex_available: [
103 "//apex_available:platform",
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100104 "com.android.art",
Jiyong Park71f661c2020-04-28 18:20:43 +0900105 "com.android.art.debug",
Martin Stjernholm694f0122020-10-30 02:23:24 +0000106 "com.android.media",
Jiyong Park71f661c2020-04-28 18:20:43 +0900107 ],
Nicolas Geoffrayec388c02021-03-03 22:09:06 +0000108 min_sdk_version: "S",
Orion Hodsonc78860b2019-10-11 11:30:01 +0100109 visibility: [
Martin Stjernholm3bb009a2019-10-17 21:29:01 +0100110 "//art:__subpackages__",
111 // TODO(b/133140750): Clean this up.
Orion Hodsonc78860b2019-10-11 11:30:01 +0100112 "//frameworks/av/media/libstagefright",
113 "//frameworks/native/libs/graphicsenv",
114 "//frameworks/native/vulkan/libvulkan",
115 ],
Orion Hodson9b16e342019-10-09 13:29:16 +0100116 host_supported: true,
117 export_include_dirs: ["include"],
Orion Hodson00cb81d2020-04-03 06:47:07 +0100118 header_libs: ["jni_headers"],
119 export_header_lib_headers: ["jni_headers"],
Orion Hodson9b16e342019-10-09 13:29:16 +0100120}
121
Martin Stjernholmb3092402020-09-04 00:49:44 +0100122art_cc_test {
Orion Hodson9b16e342019-10-09 13:29:16 +0100123 name: "libnativeloader_test",
124 srcs: [
125 "native_loader_test.cpp",
126 "native_loader.cpp",
127 "library_namespaces.cpp",
128 "native_loader_namespace.cpp",
129 "public_libraries.cpp",
130 ],
131 cflags: ["-DANDROID"],
132 static_libs: [
133 "libbase",
134 "liblog",
Orion Hodson9b16e342019-10-09 13:29:16 +0100135 "libgmock",
Justin Yun3db26d52019-12-16 14:09:39 +0900136 "PlatformProperties",
Orion Hodson9b16e342019-10-09 13:29:16 +0100137 ],
138 header_libs: [
139 "libnativebridge-headers",
Orion Hodson6dc0a432020-02-06 14:28:28 +0000140 "libnativehelper_header_only",
Orion Hodson9b16e342019-10-09 13:29:16 +0100141 "libnativeloader-headers",
142 ],
Orion Hodson43464992019-10-11 11:10:03 +0100143 // native_loader_test.cpp mocks libdl APIs so system_shared_libs
144 // are used to include C libraries without libdl.
Orion Hodson9b16e342019-10-09 13:29:16 +0100145 system_shared_libs: [
146 "libc",
147 "libm",
148 ],
149 test_suites: ["device-tests"],
150}