Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 1 | // Shared library for target |
| 2 | // ======================================================== |
| 3 | cc_defaults { |
| 4 | name: "libnativeloader-defaults", |
Martin Stjernholm | 3bb009a | 2019-10-17 21:29:01 +0100 | [diff] [blame] | 5 | defaults: ["art_defaults"], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 6 | cppflags: [ |
| 7 | "-fvisibility=hidden", |
| 8 | ], |
| 9 | header_libs: ["libnativeloader-headers"], |
| 10 | export_header_lib_headers: ["libnativeloader-headers"], |
| 11 | } |
| 12 | |
David Srbecky | 1cf46a3 | 2020-06-22 15:39:00 +0100 | [diff] [blame] | 13 | art_cc_library { |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 14 | name: "libnativeloader", |
| 15 | defaults: ["libnativeloader-defaults"], |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 16 | visibility: [ |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 17 | "//frameworks/base/cmds/app_process", |
Martin Stjernholm | 3bb009a | 2019-10-17 21:29:01 +0100 | [diff] [blame] | 18 | // TODO(b/133140750): Clean this up. |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 19 | "//frameworks/base/native/webview/loader", |
| 20 | ], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 21 | apex_available: [ |
| 22 | "com.android.art.release", |
| 23 | "com.android.art.debug", |
| 24 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 25 | host_supported: true, |
| 26 | srcs: [ |
| 27 | "native_loader.cpp", |
| 28 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 29 | header_libs: [ |
| 30 | "libnativehelper_header_only", |
| 31 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 32 | shared_libs: [ |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 33 | "liblog", |
| 34 | "libnativebridge", |
| 35 | "libbase", |
| 36 | ], |
| 37 | target: { |
David Srbecky | c4b50b3 | 2020-07-01 15:10:23 +0100 | [diff] [blame] | 38 | // 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 Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 51 | 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 Yun | 3db26d5 | 2019-12-16 14:09:39 +0900 | [diff] [blame] | 60 | whole_static_libs: [ |
| 61 | "PlatformProperties", |
| 62 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 63 | }, |
| 64 | }, |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 65 | stubs: { |
| 66 | symbol_file: "libnativeloader.map.txt", |
| 67 | versions: ["1"], |
| 68 | }, |
| 69 | } |
| 70 | |
| 71 | // TODO(b/124250621) eliminate the need for this library |
| 72 | cc_library { |
| 73 | name: "libnativeloader_lazy", |
| 74 | defaults: ["libnativeloader-defaults"], |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 75 | visibility: [ |
| 76 | "//frameworks/base/core/jni", |
| 77 | "//frameworks/native/opengl/libs", |
| 78 | "//frameworks/native/vulkan/libvulkan", |
| 79 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 80 | host_supported: false, |
| 81 | srcs: ["native_loader_lazy.cpp"], |
| 82 | required: ["libnativeloader"], |
Mitch Phillips | 5472d6f | 2020-07-01 09:43:16 -0700 | [diff] [blame] | 83 | shared_libs: ["liblog"], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | cc_library_headers { |
| 87 | name: "libnativeloader-headers", |
Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 88 | apex_available: [ |
| 89 | "//apex_available:platform", |
| 90 | "com.android.art.debug", |
| 91 | "com.android.art.release", |
| 92 | ], |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 93 | visibility: [ |
Martin Stjernholm | 3bb009a | 2019-10-17 21:29:01 +0100 | [diff] [blame] | 94 | "//art:__subpackages__", |
| 95 | // TODO(b/133140750): Clean this up. |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 96 | "//frameworks/av/media/libstagefright", |
| 97 | "//frameworks/native/libs/graphicsenv", |
| 98 | "//frameworks/native/vulkan/libvulkan", |
| 99 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 100 | host_supported: true, |
| 101 | export_include_dirs: ["include"], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 102 | header_libs: ["jni_headers"], |
| 103 | export_header_lib_headers: ["jni_headers"], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | cc_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 Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 119 | "libgmock", |
Justin Yun | 3db26d5 | 2019-12-16 14:09:39 +0900 | [diff] [blame] | 120 | "PlatformProperties", |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 121 | ], |
| 122 | header_libs: [ |
| 123 | "libnativebridge-headers", |
Orion Hodson | 6dc0a43 | 2020-02-06 14:28:28 +0000 | [diff] [blame] | 124 | "libnativehelper_header_only", |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 125 | "libnativeloader-headers", |
| 126 | ], |
Orion Hodson | 4346499 | 2019-10-11 11:10:03 +0100 | [diff] [blame] | 127 | // native_loader_test.cpp mocks libdl APIs so system_shared_libs |
| 128 | // are used to include C libraries without libdl. |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 129 | system_shared_libs: [ |
| 130 | "libc", |
| 131 | "libm", |
| 132 | ], |
| 133 | test_suites: ["device-tests"], |
| 134 | } |