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 | |
| 13 | cc_library { |
| 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 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 21 | 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 |
| 54 | cc_library { |
| 55 | name: "libnativeloader_lazy", |
| 56 | defaults: ["libnativeloader-defaults"], |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 57 | visibility: [ |
| 58 | "//frameworks/base/core/jni", |
| 59 | "//frameworks/native/opengl/libs", |
| 60 | "//frameworks/native/vulkan/libvulkan", |
| 61 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 62 | host_supported: false, |
| 63 | srcs: ["native_loader_lazy.cpp"], |
| 64 | required: ["libnativeloader"], |
| 65 | } |
| 66 | |
| 67 | cc_library_headers { |
| 68 | name: "libnativeloader-headers", |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 69 | visibility: [ |
Martin Stjernholm | 3bb009a | 2019-10-17 21:29:01 +0100 | [diff] [blame^] | 70 | "//art:__subpackages__", |
| 71 | // TODO(b/133140750): Clean this up. |
Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 72 | "//frameworks/av/media/libstagefright", |
| 73 | "//frameworks/native/libs/graphicsenv", |
| 74 | "//frameworks/native/vulkan/libvulkan", |
| 75 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 76 | host_supported: true, |
| 77 | export_include_dirs: ["include"], |
| 78 | } |
| 79 | |
| 80 | cc_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 Hodson | 4346499 | 2019-10-11 11:10:03 +0100 | [diff] [blame] | 100 | // native_loader_test.cpp mocks libdl APIs so system_shared_libs |
| 101 | // are used to include C libraries without libdl. |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 102 | system_shared_libs: [ |
| 103 | "libc", |
| 104 | "libm", |
| 105 | ], |
| 106 | test_suites: ["device-tests"], |
| 107 | } |