blob: beb2c8c042f546378e44e80557888a8a48b002db [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
13cc_library {
14 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 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010021 host_supported: true,
22 srcs: [
23 "native_loader.cpp",
24 ],
25 shared_libs: [
26 "libnativehelper",
27 "liblog",
28 "libnativebridge",
29 "libbase",
30 ],
31 target: {
32 android: {
33 srcs: [
34 "library_namespaces.cpp",
35 "native_loader_namespace.cpp",
36 "public_libraries.cpp",
37 ],
38 shared_libs: [
39 "libdl_android",
40 ],
41 },
42 },
43 required: [
44 "llndk.libraries.txt",
45 "vndksp.libraries.txt",
46 ],
47 stubs: {
48 symbol_file: "libnativeloader.map.txt",
49 versions: ["1"],
50 },
51}
52
53// TODO(b/124250621) eliminate the need for this library
54cc_library {
55 name: "libnativeloader_lazy",
56 defaults: ["libnativeloader-defaults"],
Orion Hodsonc78860b2019-10-11 11:30:01 +010057 visibility: [
58 "//frameworks/base/core/jni",
59 "//frameworks/native/opengl/libs",
60 "//frameworks/native/vulkan/libvulkan",
61 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010062 host_supported: false,
63 srcs: ["native_loader_lazy.cpp"],
64 required: ["libnativeloader"],
65}
66
67cc_library_headers {
68 name: "libnativeloader-headers",
Orion Hodsonc78860b2019-10-11 11:30:01 +010069 visibility: [
Martin Stjernholm3bb009a2019-10-17 21:29:01 +010070 "//art:__subpackages__",
71 // TODO(b/133140750): Clean this up.
Orion Hodsonc78860b2019-10-11 11:30:01 +010072 "//frameworks/av/media/libstagefright",
73 "//frameworks/native/libs/graphicsenv",
74 "//frameworks/native/vulkan/libvulkan",
75 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010076 host_supported: true,
77 export_include_dirs: ["include"],
78}
79
80cc_test {
81 name: "libnativeloader_test",
82 srcs: [
83 "native_loader_test.cpp",
84 "native_loader.cpp",
85 "library_namespaces.cpp",
86 "native_loader_namespace.cpp",
87 "public_libraries.cpp",
88 ],
89 cflags: ["-DANDROID"],
90 static_libs: [
91 "libbase",
92 "liblog",
93 "libnativehelper",
94 "libgmock",
95 ],
96 header_libs: [
97 "libnativebridge-headers",
98 "libnativeloader-headers",
99 ],
Orion Hodson43464992019-10-11 11:10:03 +0100100 // native_loader_test.cpp mocks libdl APIs so system_shared_libs
101 // are used to include C libraries without libdl.
Orion Hodson9b16e342019-10-09 13:29:16 +0100102 system_shared_libs: [
103 "libc",
104 "libm",
105 ],
106 test_suites: ["device-tests"],
107}