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 { |
| 18 | name: "libartpalette_defaults", |
| 19 | defaults: ["art_defaults"], |
| 20 | host_supported: true, |
| 21 | export_include_dirs: ["include"], |
| 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: { |
| 32 | srcs: ["system/palette_android.cc",], |
| 33 | header_libs: ["libbase_headers"], |
| 34 | shared_libs: [ |
Martin Stjernholm | 2e2c45e | 2019-04-09 20:40:59 +0100 | [diff] [blame] | 35 | "libbase", |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 36 | "libcutils", |
| 37 | "liblog", |
| 38 | "libprocessgroup", |
Martin Stjernholm | 2e2c45e | 2019-04-09 20:40:59 +0100 | [diff] [blame] | 39 | "libtombstoned_client", |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 40 | ], |
| 41 | }, |
| 42 | host: { |
| 43 | header_libs: ["libbase_headers"], |
| 44 | srcs: ["system/palette_fake.cc",], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame^] | 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"], |
| 66 | required: ["libartpalette-system"], // libartpalette.so dlopen()'s libartpalette-system. |
| 67 | header_libs: ["libbase_headers"], |
| 68 | target: { |
| 69 | // Targets supporting dlopen build the client library which loads |
| 70 | // and binds the methods in the libartpalette-system library. |
| 71 | android: { |
| 72 | srcs: ["apex/palette.cc"], |
| 73 | shared: { |
| 74 | shared_libs: ["liblog"], |
| 75 | }, |
| 76 | static: { |
| 77 | static_libs: ["liblog"], |
| 78 | }, |
| 79 | version_script: "libartpalette.map.txt", |
| 80 | }, |
| 81 | linux_bionic: { |
| 82 | header_libs: ["libbase_headers"], |
| 83 | srcs: ["system/palette_fake.cc"], |
| 84 | shared: { |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame^] | 85 | shared_libs: [ |
| 86 | "libbase", |
| 87 | "liblog" |
| 88 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 89 | }, |
| 90 | version_script: "libartpalette.map.txt", |
| 91 | }, |
| 92 | linux_glibc: { |
| 93 | header_libs: ["libbase_headers"], |
| 94 | srcs: ["system/palette_fake.cc"], |
| 95 | shared: { |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame^] | 96 | shared_libs: [ |
| 97 | "libbase", |
| 98 | "liblog" |
| 99 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 100 | }, |
| 101 | version_script: "libartpalette.map.txt", |
| 102 | }, |
| 103 | // Targets without support for dlopen just use the sources for |
| 104 | // the system library which actually implements functionality. |
| 105 | darwin: { |
| 106 | enabled: true, |
| 107 | header_libs: ["libbase_headers"], |
| 108 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame^] | 109 | static_libs: [ |
| 110 | "libbase", |
| 111 | "liblog" |
| 112 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 113 | }, |
| 114 | windows: { |
| 115 | enabled: true, |
| 116 | header_libs: ["libbase_headers"], |
| 117 | srcs: ["system/palette_fake.cc"], |
Orion Hodson | d3374a0 | 2019-05-02 10:56:33 +0100 | [diff] [blame^] | 118 | static_libs: [ |
| 119 | "libbase", |
| 120 | "liblog" |
| 121 | ], |
Orion Hodson | 119733d | 2019-01-30 15:14:41 +0000 | [diff] [blame] | 122 | }, |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | art_cc_test { |
| 127 | name: "art_libartpalette_tests", |
| 128 | defaults: ["art_gtest_defaults"], |
| 129 | host_supported: true, |
| 130 | srcs: ["apex/palette_test.cc"], |
| 131 | shared_libs: ["libartpalette"], |
| 132 | test_per_src: true, |
| 133 | } |