blob: 33a2c8f483fc9e954e1553dedf35e411f31e7040 [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 Srbecky22872da2020-06-25 15:23:15 +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"],
83}
84
85cc_library_headers {
86 name: "libnativeloader-headers",
Jiyong Park71f661c2020-04-28 18:20:43 +090087 apex_available: [
88 "//apex_available:platform",
89 "com.android.art.debug",
90 "com.android.art.release",
91 ],
Orion Hodsonc78860b2019-10-11 11:30:01 +010092 visibility: [
Martin Stjernholm3bb009a2019-10-17 21:29:01 +010093 "//art:__subpackages__",
94 // TODO(b/133140750): Clean this up.
Orion Hodsonc78860b2019-10-11 11:30:01 +010095 "//frameworks/av/media/libstagefright",
96 "//frameworks/native/libs/graphicsenv",
97 "//frameworks/native/vulkan/libvulkan",
98 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010099 host_supported: true,
100 export_include_dirs: ["include"],
Orion Hodson00cb81d2020-04-03 06:47:07 +0100101 header_libs: ["jni_headers"],
102 export_header_lib_headers: ["jni_headers"],
Orion Hodson9b16e342019-10-09 13:29:16 +0100103}
104
105cc_test {
106 name: "libnativeloader_test",
107 srcs: [
108 "native_loader_test.cpp",
109 "native_loader.cpp",
110 "library_namespaces.cpp",
111 "native_loader_namespace.cpp",
112 "public_libraries.cpp",
113 ],
114 cflags: ["-DANDROID"],
115 static_libs: [
116 "libbase",
117 "liblog",
Orion Hodson9b16e342019-10-09 13:29:16 +0100118 "libgmock",
Justin Yun3db26d52019-12-16 14:09:39 +0900119 "PlatformProperties",
Orion Hodson9b16e342019-10-09 13:29:16 +0100120 ],
121 header_libs: [
122 "libnativebridge-headers",
Orion Hodson6dc0a432020-02-06 14:28:28 +0000123 "libnativehelper_header_only",
Orion Hodson9b16e342019-10-09 13:29:16 +0100124 "libnativeloader-headers",
125 ],
Orion Hodson43464992019-10-11 11:10:03 +0100126 // native_loader_test.cpp mocks libdl APIs so system_shared_libs
127 // are used to include C libraries without libdl.
Orion Hodson9b16e342019-10-09 13:29:16 +0100128 system_shared_libs: [
129 "libc",
130 "libm",
131 ],
132 test_suites: ["device-tests"],
133}