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"], |
| 44 | shared: { |
| 45 | shared_libs: ["liblog"], |
| 46 | }, |
| 47 | static: { |
| 48 | static_libs: ["liblog"], |
| 49 | }, |
| 50 | version_script: "libartpalette.map.txt", |
| 51 | }, |
| 52 | linux_bionic: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 53 | header_libs: ["libbase_headers"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 54 | srcs: ["system/palette_fake.cc"], |
| 55 | shared: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 56 | shared_libs: [ |
| 57 | "libbase", |
| 58 | "liblog", |
| 59 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 60 | }, |
| 61 | version_script: "libartpalette.map.txt", |
| 62 | }, |
| 63 | linux_glibc: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 64 | header_libs: ["libbase_headers"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 65 | srcs: ["system/palette_fake.cc"], |
| 66 | shared: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 67 | shared_libs: [ |
| 68 | "libbase", |
| 69 | "liblog", |
| 70 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 71 | }, |
| 72 | version_script: "libartpalette.map.txt", |
| 73 | }, |
| 74 | // Targets without support for dlopen just use the sources for |
| 75 | // the system library which actually implements functionality. |
| 76 | darwin: { |
| 77 | enabled: true, |
| 78 | header_libs: ["libbase_headers"], |
| 79 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 80 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 81 | "libbase", |
| 82 | "liblog", |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 83 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 84 | }, |
| 85 | windows: { |
| 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 | }, |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 94 | }, |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame^] | 95 | apex_available: [ |
| 96 | "com.android.art.release", |
| 97 | "com.android.art.debug", |
| 98 | // TODO(b/142944931) Clean this up. This is due to the dependency to libdexfile_support_static |
| 99 | // from /system/core, etc. |
| 100 | "//apex_available:platform", |
| 101 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | art_cc_test { |
| 105 | name: "art_libartpalette_tests", |
| 106 | defaults: ["art_gtest_defaults"], |
| 107 | host_supported: true, |
| 108 | srcs: ["apex/palette_test.cc"], |
| 109 | shared_libs: ["libartpalette"], |
| 110 | test_per_src: true, |
| 111 | } |