blob: 47735febcc07fe23e74deb46de6ca861b2908aad [file] [log] [blame]
Orion Hodson9b16e342019-10-09 13:29:16 +01001// Shared library for target
2// ========================================================
3cc_defaults {
4 name: "libnativeloader-defaults",
Martin Stjernholm3bb009a2019-10-17 21:29:01 +01005 defaults: ["art_defaults"],
Orion Hodson9b16e342019-10-09 13:29:16 +01006 cppflags: [
7 "-fvisibility=hidden",
8 ],
9 header_libs: ["libnativeloader-headers"],
10 export_header_lib_headers: ["libnativeloader-headers"],
11}
12
David Srbecky1cf46a32020-06-22 15:39:00 +010013art_cc_library {
Orion Hodson9b16e342019-10-09 13:29:16 +010014 name: "libnativeloader",
15 defaults: ["libnativeloader-defaults"],
Orion Hodsonc78860b2019-10-11 11:30:01 +010016 visibility: [
Orion Hodsonc78860b2019-10-11 11:30:01 +010017 "//frameworks/base/cmds/app_process",
Martin Stjernholm3bb009a2019-10-17 21:29:01 +010018 // TODO(b/133140750): Clean this up.
Orion Hodsonc78860b2019-10-11 11:30:01 +010019 "//frameworks/base/native/webview/loader",
20 ],
Jiyong Park066dd9022019-12-19 02:11:59 +000021 apex_available: [
22 "com.android.art.release",
23 "com.android.art.debug",
24 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010025 host_supported: true,
26 srcs: [
27 "native_loader.cpp",
28 ],
Orion Hodson00cb81d2020-04-03 06:47:07 +010029 header_libs: [
30 "libnativehelper_header_only",
31 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010032 shared_libs: [
Orion Hodson9b16e342019-10-09 13:29:16 +010033 "liblog",
34 "libnativebridge",
35 "libbase",
36 ],
37 target: {
David Srbeckyc4b50b32020-07-01 15:10:23 +010038 // Library search path needed for running host tests remotely (from testcases directory).
39 linux_glibc_x86: {
40 ldflags: [
41 "-Wl,-rpath,$ORIGIN/../art_common/out/host/linux-x86/lib",
42 "-Wl,--enable-new-dtags",
43 ],
44 },
45 linux_glibc_x86_64: {
46 ldflags: [
47 "-Wl,-rpath,$ORIGIN/../art_common/out/host/linux-x86/lib64",
48 "-Wl,--enable-new-dtags",
49 ],
50 },
Orion Hodson9b16e342019-10-09 13:29:16 +010051 android: {
52 srcs: [
53 "library_namespaces.cpp",
54 "native_loader_namespace.cpp",
55 "public_libraries.cpp",
56 ],
57 shared_libs: [
58 "libdl_android",
59 ],
Justin Yun3db26d52019-12-16 14:09:39 +090060 whole_static_libs: [
61 "PlatformProperties",
62 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010063 },
64 },
Orion Hodson9b16e342019-10-09 13:29:16 +010065 stubs: {
66 symbol_file: "libnativeloader.map.txt",
67 versions: ["1"],
68 },
69}
70
71// TODO(b/124250621) eliminate the need for this library
72cc_library {
73 name: "libnativeloader_lazy",
74 defaults: ["libnativeloader-defaults"],
Orion Hodsonc78860b2019-10-11 11:30:01 +010075 visibility: [
76 "//frameworks/base/core/jni",
77 "//frameworks/native/opengl/libs",
78 "//frameworks/native/vulkan/libvulkan",
79 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010080 host_supported: false,
81 srcs: ["native_loader_lazy.cpp"],
82 required: ["libnativeloader"],
Mitch Phillips5472d6f2020-07-01 09:43:16 -070083 shared_libs: ["liblog"],
Orion Hodson9b16e342019-10-09 13:29:16 +010084}
85
86cc_library_headers {
87 name: "libnativeloader-headers",
Jiyong Park71f661c2020-04-28 18:20:43 +090088 apex_available: [
89 "//apex_available:platform",
90 "com.android.art.debug",
91 "com.android.art.release",
92 ],
Orion Hodsonc78860b2019-10-11 11:30:01 +010093 visibility: [
Martin Stjernholm3bb009a2019-10-17 21:29:01 +010094 "//art:__subpackages__",
95 // TODO(b/133140750): Clean this up.
Orion Hodsonc78860b2019-10-11 11:30:01 +010096 "//frameworks/av/media/libstagefright",
97 "//frameworks/native/libs/graphicsenv",
98 "//frameworks/native/vulkan/libvulkan",
99 ],
Orion Hodson9b16e342019-10-09 13:29:16 +0100100 host_supported: true,
101 export_include_dirs: ["include"],
Orion Hodson00cb81d2020-04-03 06:47:07 +0100102 header_libs: ["jni_headers"],
103 export_header_lib_headers: ["jni_headers"],
Orion Hodson9b16e342019-10-09 13:29:16 +0100104}
105
106cc_test {
107 name: "libnativeloader_test",
108 srcs: [
109 "native_loader_test.cpp",
110 "native_loader.cpp",
111 "library_namespaces.cpp",
112 "native_loader_namespace.cpp",
113 "public_libraries.cpp",
114 ],
115 cflags: ["-DANDROID"],
116 static_libs: [
117 "libbase",
118 "liblog",
Orion Hodson9b16e342019-10-09 13:29:16 +0100119 "libgmock",
Justin Yun3db26d52019-12-16 14:09:39 +0900120 "PlatformProperties",
Orion Hodson9b16e342019-10-09 13:29:16 +0100121 ],
122 header_libs: [
123 "libnativebridge-headers",
Orion Hodson6dc0a432020-02-06 14:28:28 +0000124 "libnativehelper_header_only",
Orion Hodson9b16e342019-10-09 13:29:16 +0100125 "libnativeloader-headers",
126 ],
Orion Hodson43464992019-10-11 11:10:03 +0100127 // native_loader_test.cpp mocks libdl APIs so system_shared_libs
128 // are used to include C libraries without libdl.
Orion Hodson9b16e342019-10-09 13:29:16 +0100129 system_shared_libs: [
130 "libc",
131 "libm",
132 ],
133 test_suites: ["device-tests"],
134}