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 17cc_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. 26art_cc_library { 27 name: "libartpalette-system", 28 defaults: ["libartpalette_defaults"], 29 compile_multilib: "both", 30 target: { 31 android: { 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 ], 41 }, 42 host: { 43 header_libs: ["libbase_headers"], 44 srcs: ["system/palette_fake.cc",], 45 shared_libs: ["libbase"], 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. 63art_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: { 85 shared_libs: [ 86 "libbase", 87 "liblog" 88 ], 89 }, 90 version_script: "libartpalette.map.txt", 91 }, 92 linux_glibc: { 93 header_libs: ["libbase_headers"], 94 srcs: ["system/palette_fake.cc"], 95 shared: { 96 shared_libs: [ 97 "libbase", 98 "liblog" 99 ], 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"], 109 static_libs: [ 110 "libbase", 111 "liblog" 112 ], 113 }, 114 windows: { 115 enabled: true, 116 header_libs: ["libbase_headers"], 117 srcs: ["system/palette_fake.cc"], 118 static_libs: [ 119 "libbase", 120 "liblog" 121 ], 122 }, 123 } 124} 125 126art_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} 134