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 | |
| 17 | cc_defaults { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 18 | name: "libartpalette_defaults", |
| 19 | defaults: ["art_defaults"], |
| 20 | host_supported: true, |
| 21 | export_include_dirs: ["include"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 22 | } |
| 23 | |
Orion Hodson | c8315d9 | 2019-11-01 13:02:02 +0000 | [diff] [blame] | 24 | cc_library_headers { |
| 25 | name: "libartpalette-headers", |
| 26 | export_include_dirs: ["include"], |
| 27 | host_supported: true, |
Paul Duffin | cc9df4f | 2020-08-13 14:57:41 +0100 | [diff] [blame] | 28 | visibility: [ |
| 29 | "//art:__subpackages__", |
| 30 | "//system/libartpalette", |
| 31 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | // libartpalette is the dynamic loader of the platform abstraction |
| 35 | // layer. It is only used on Android. For other targets, it just |
| 36 | // implements a fake platform implementation. |
| 37 | art_cc_library { |
| 38 | name: "libartpalette", |
| 39 | defaults: ["libartpalette_defaults"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 40 | header_libs: ["libbase_headers"], |
| 41 | target: { |
| 42 | // Targets supporting dlopen build the client library which loads |
| 43 | // and binds the methods in the libartpalette-system library. |
| 44 | android: { |
Yo Chiang | 4c04514 | 2020-05-26 17:37:49 +0800 | [diff] [blame] | 45 | // libartpalette.so dlopen()'s libartpalette-system. |
| 46 | required: ["libartpalette-system"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 47 | srcs: ["apex/palette.cc"], |
Jiyong Park | 1926f2e | 2020-03-11 10:21:49 +0900 | [diff] [blame] | 48 | shared_libs: ["liblog"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 49 | version_script: "libartpalette.map.txt", |
| 50 | }, |
| 51 | linux_bionic: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 52 | header_libs: ["libbase_headers"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 53 | srcs: ["system/palette_fake.cc"], |
| 54 | shared: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 55 | shared_libs: [ |
| 56 | "libbase", |
| 57 | "liblog", |
| 58 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 59 | }, |
| 60 | version_script: "libartpalette.map.txt", |
| 61 | }, |
| 62 | linux_glibc: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 63 | header_libs: ["libbase_headers"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 64 | srcs: ["system/palette_fake.cc"], |
| 65 | shared: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 66 | shared_libs: [ |
| 67 | "libbase", |
| 68 | "liblog", |
| 69 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 70 | }, |
| 71 | version_script: "libartpalette.map.txt", |
| 72 | }, |
| 73 | // Targets without support for dlopen just use the sources for |
| 74 | // the system library which actually implements functionality. |
| 75 | darwin: { |
| 76 | enabled: true, |
| 77 | header_libs: ["libbase_headers"], |
| 78 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 79 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 80 | "libbase", |
| 81 | "liblog", |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 82 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 83 | }, |
| 84 | windows: { |
| 85 | enabled: true, |
| 86 | header_libs: ["libbase_headers"], |
| 87 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 88 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 89 | "libbase", |
| 90 | "liblog", |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 91 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 92 | }, |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 93 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 94 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 95 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 96 | "com.android.art.debug", |
Jiyong Park | 7c2f69e | 2020-01-15 15:43:32 +0900 | [diff] [blame] | 97 | // TODO(b/142944931): remove this |
| 98 | "com.android.runtime", // due to the transitive dependency from linker |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 99 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | art_cc_test { |
| 103 | name: "art_libartpalette_tests", |
| 104 | defaults: ["art_gtest_defaults"], |
| 105 | host_supported: true, |
| 106 | srcs: ["apex/palette_test.cc"], |
| 107 | shared_libs: ["libartpalette"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 108 | } |