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