Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2019 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
Bob Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 17 | package { |
| 18 | // See: http://go/android-license-faq |
| 19 | // A large-scale-change added 'default_applicable_licenses' to import |
| 20 | // all of the 'license_kinds' from "art_license" |
| 21 | // to get the below license kinds: |
| 22 | // SPDX-license-identifier-Apache-2.0 |
| 23 | default_applicable_licenses: ["art_license"], |
| 24 | } |
| 25 | |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 26 | cc_defaults { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 27 | name: "libartpalette_defaults", |
| 28 | defaults: ["art_defaults"], |
| 29 | host_supported: true, |
| 30 | export_include_dirs: ["include"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Orion Hodson | c8315d9 | 2019-11-01 13:02:02 +0000 | [diff] [blame] | 33 | cc_library_headers { |
| 34 | name: "libartpalette-headers", |
| 35 | export_include_dirs: ["include"], |
| 36 | host_supported: true, |
Paul Duffin | cc9df4f | 2020-08-13 14:57:41 +0100 | [diff] [blame] | 37 | visibility: [ |
| 38 | "//art:__subpackages__", |
| 39 | "//system/libartpalette", |
| 40 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | // libartpalette is the dynamic loader of the platform abstraction |
| 44 | // layer. It is only used on Android. For other targets, it just |
| 45 | // implements a fake platform implementation. |
| 46 | art_cc_library { |
| 47 | name: "libartpalette", |
| 48 | defaults: ["libartpalette_defaults"], |
Martin Stjernholm | 4312f74 | 2021-03-23 00:30:57 +0000 | [diff] [blame] | 49 | visibility: [ |
| 50 | // TODO(b/183483755): Please visibility checks when the prebuilt |
| 51 | // libartpalette is present but not preferred, and the prebuilt |
| 52 | // libdexfile hence depends on the source instead. |
| 53 | // TODO(b/172480617): Alternatively, clean up when we no longer need to |
| 54 | // support both prebuilts and sources present simultaneously. |
| 55 | "//prebuilts/module_sdk/art/current/host-exports", |
Pranav Gupta | 19bc778 | 2022-12-20 00:27:15 +0000 | [diff] [blame] | 56 | "//prebuilts/module_sdk/art/go/current/host-exports", |
Martin Stjernholm | 4312f74 | 2021-03-23 00:30:57 +0000 | [diff] [blame] | 57 | ], |
Nicolas Geoffray | c3db254 | 2021-04-20 15:50:04 +0000 | [diff] [blame] | 58 | header_libs: [ |
| 59 | "libbase_headers", |
| 60 | "jni_headers", |
| 61 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 62 | target: { |
| 63 | // Targets supporting dlopen build the client library which loads |
| 64 | // and binds the methods in the libartpalette-system library. |
| 65 | android: { |
Yo Chiang | 4c04514 | 2020-05-26 17:37:49 +0800 | [diff] [blame] | 66 | // libartpalette.so dlopen()'s libartpalette-system. |
Martin Stjernholm | 108d4d6 | 2021-04-13 21:14:53 +0100 | [diff] [blame] | 67 | runtime_libs: ["libartpalette-system"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 68 | srcs: ["apex/palette.cc"], |
Jiyong Park | 1926f2e | 2020-03-11 10:21:49 +0900 | [diff] [blame] | 69 | shared_libs: ["liblog"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 70 | version_script: "libartpalette.map.txt", |
| 71 | }, |
Colin Cross | 8f146f9 | 2022-03-18 16:24:36 -0700 | [diff] [blame] | 72 | host_linux: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 73 | header_libs: ["libbase_headers"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 74 | srcs: ["system/palette_fake.cc"], |
| 75 | shared: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 76 | shared_libs: [ |
| 77 | "libbase", |
| 78 | "liblog", |
| 79 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 80 | }, |
| 81 | version_script: "libartpalette.map.txt", |
| 82 | }, |
| 83 | // Targets without support for dlopen just use the sources for |
| 84 | // the system library which actually implements functionality. |
| 85 | darwin: { |
| 86 | enabled: true, |
| 87 | header_libs: ["libbase_headers"], |
| 88 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 89 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 90 | "libbase", |
| 91 | "liblog", |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 92 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 93 | }, |
| 94 | windows: { |
| 95 | enabled: true, |
| 96 | header_libs: ["libbase_headers"], |
| 97 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 98 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 99 | "libbase", |
| 100 | "liblog", |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 101 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 102 | }, |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 103 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 104 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 105 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 106 | "com.android.art.debug", |
Jiyong Park | 7c2f69e | 2020-01-15 15:43:32 +0900 | [diff] [blame] | 107 | // TODO(b/142944931): remove this |
| 108 | "com.android.runtime", // due to the transitive dependency from linker |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 109 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 110 | } |
| 111 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 112 | art_cc_defaults { |
| 113 | name: "art_libartpalette_tests_defaults", |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 114 | srcs: ["apex/palette_test.cc"], |
Martin Stjernholm | d4aba91 | 2022-01-25 21:05:47 +0000 | [diff] [blame] | 115 | shared_libs: [ |
| 116 | "libartpalette", |
| 117 | "libnativehelper", |
| 118 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 119 | } |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 120 | |
| 121 | // Version of ART gtest `art_libartpalette_tests` bundled with the ART APEX on target. |
| 122 | // TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. |
| 123 | art_cc_test { |
| 124 | name: "art_libartpalette_tests", |
| 125 | defaults: [ |
| 126 | "art_gtest_defaults", |
| 127 | "art_libartpalette_tests_defaults", |
| 128 | ], |
| 129 | host_supported: true, |
| 130 | } |
| 131 | |
| 132 | // Standalone version of ART gtest `art_libartpalette_tests`, not bundled with the ART APEX on |
| 133 | // target. |
| 134 | art_cc_test { |
| 135 | name: "art_standalone_libartpalette_tests", |
| 136 | defaults: [ |
| 137 | "art_standalone_gtest_defaults", |
| 138 | "art_libartpalette_tests_defaults", |
| 139 | ], |
Roland Levillain | 24d589e | 2021-11-23 15:34:31 +0000 | [diff] [blame] | 140 | test_config_template: ":art-gtests-target-standalone-cts-template", |
| 141 | test_suites: ["cts"], |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 142 | } |