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 | |
| 24 | // libartpalette-system is the implementation of the abstraction layer. It is |
| 25 | // only available as a shared library on Android. |
| 26 | art_cc_library { |
| 27 | name: "libartpalette-system", |
| 28 | defaults: ["libartpalette_defaults"], |
Orion Hodson | 6a06cd8 | 2019-02-20 09:34:35 +0000 | [diff] [blame] | 29 | compile_multilib: "both", |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 30 | target: { |
| 31 | android: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 32 | srcs: ["system/palette_android.cc"], |
| 33 | header_libs: ["libbase_headers"], |
| 34 | shared_libs: [ |
| 35 | "libbase", |
| 36 | "libcutils", |
| 37 | "liblog", |
| 38 | "libprocessgroup", |
| 39 | "libtombstoned_client", |
| 40 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 41 | }, |
| 42 | host: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 43 | header_libs: ["libbase_headers"], |
| 44 | srcs: ["system/palette_fake.cc"], |
| 45 | shared_libs: ["libbase"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 46 | }, |
| 47 | darwin: { |
| 48 | enabled: false, |
| 49 | }, |
| 50 | windows: { |
| 51 | enabled: false, |
| 52 | }, |
| 53 | }, |
| 54 | static: { |
| 55 | enabled: false, |
| 56 | }, |
| 57 | version_script: "libartpalette.map.txt", |
| 58 | } |
| 59 | |
| 60 | // libartpalette is the dynamic loader of the platform abstraction |
| 61 | // layer. It is only used on Android. For other targets, it just |
| 62 | // implements a fake platform implementation. |
| 63 | art_cc_library { |
| 64 | name: "libartpalette", |
| 65 | defaults: ["libartpalette_defaults"], |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 66 | visibility: [ |
| 67 | // TODO(b/133140750): Clean this up. |
| 68 | "//frameworks/base/startop/view_compiler", |
| 69 | "//system/extras/simpleperf", |
| 70 | ], |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 71 | required: ["libartpalette-system"], // libartpalette.so dlopen()'s libartpalette-system. |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 72 | header_libs: ["libbase_headers"], |
| 73 | target: { |
| 74 | // Targets supporting dlopen build the client library which loads |
| 75 | // and binds the methods in the libartpalette-system library. |
| 76 | android: { |
| 77 | srcs: ["apex/palette.cc"], |
| 78 | shared: { |
| 79 | shared_libs: ["liblog"], |
| 80 | }, |
| 81 | static: { |
| 82 | static_libs: ["liblog"], |
| 83 | }, |
| 84 | version_script: "libartpalette.map.txt", |
| 85 | }, |
| 86 | linux_bionic: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 87 | header_libs: ["libbase_headers"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 88 | srcs: ["system/palette_fake.cc"], |
| 89 | shared: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 90 | shared_libs: [ |
| 91 | "libbase", |
| 92 | "liblog", |
| 93 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 94 | }, |
| 95 | version_script: "libartpalette.map.txt", |
| 96 | }, |
| 97 | linux_glibc: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 98 | header_libs: ["libbase_headers"], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 99 | srcs: ["system/palette_fake.cc"], |
| 100 | shared: { |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 101 | shared_libs: [ |
| 102 | "libbase", |
| 103 | "liblog", |
| 104 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 105 | }, |
| 106 | version_script: "libartpalette.map.txt", |
| 107 | }, |
| 108 | // Targets without support for dlopen just use the sources for |
| 109 | // the system library which actually implements functionality. |
| 110 | darwin: { |
| 111 | enabled: true, |
| 112 | header_libs: ["libbase_headers"], |
| 113 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 114 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 115 | "libbase", |
| 116 | "liblog", |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 117 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 118 | }, |
| 119 | windows: { |
| 120 | enabled: true, |
| 121 | header_libs: ["libbase_headers"], |
| 122 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 123 | static_libs: [ |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 124 | "libbase", |
| 125 | "liblog", |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame] | 126 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 127 | }, |
Andreas Gampe | 0dc93b1 | 2019-05-15 10:30:22 -0700 | [diff] [blame] | 128 | }, |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | art_cc_test { |
| 132 | name: "art_libartpalette_tests", |
| 133 | defaults: ["art_gtest_defaults"], |
| 134 | host_supported: true, |
| 135 | srcs: ["apex/palette_test.cc"], |
| 136 | shared_libs: ["libartpalette"], |
| 137 | test_per_src: true, |
| 138 | } |