blob: 80e67fde2a1b76a9cfb635f560c7eec5788f130f [file] [log] [blame]
Orion Hodson119733d2019-01-30 15:14:41 +00001//
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 {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070018 name: "libartpalette_defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
21 export_include_dirs: ["include"],
Orion Hodson119733d2019-01-30 15:14:41 +000022}
23
Orion Hodsonc8315d92019-11-01 13:02:02 +000024cc_library_headers {
25 name: "libartpalette-headers",
26 export_include_dirs: ["include"],
27 host_supported: true,
Paul Duffincc9df4f2020-08-13 14:57:41 +010028 visibility: [
29 "//art:__subpackages__",
30 "//system/libartpalette",
31 ],
Orion Hodson119733d2019-01-30 15:14:41 +000032}
33
34// libartpalette is the dynamic loader of the platform abstraction
35// layer. It is only used on Android. For other targets, it just
36// implements a fake platform implementation.
37art_cc_library {
38 name: "libartpalette",
39 defaults: ["libartpalette_defaults"],
Orion Hodson119733d2019-01-30 15:14:41 +000040 header_libs: ["libbase_headers"],
41 target: {
42 // Targets supporting dlopen build the client library which loads
43 // and binds the methods in the libartpalette-system library.
44 android: {
Yo Chiang4c045142020-05-26 17:37:49 +080045 // libartpalette.so dlopen()'s libartpalette-system.
46 required: ["libartpalette-system"],
Orion Hodson119733d2019-01-30 15:14:41 +000047 srcs: ["apex/palette.cc"],
Jiyong Park1926f2e2020-03-11 10:21:49 +090048 shared_libs: ["liblog"],
Orion Hodson119733d2019-01-30 15:14:41 +000049 version_script: "libartpalette.map.txt",
50 },
51 linux_bionic: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070052 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000053 srcs: ["system/palette_fake.cc"],
54 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070055 shared_libs: [
56 "libbase",
57 "liblog",
58 ],
Orion Hodson119733d2019-01-30 15:14:41 +000059 },
60 version_script: "libartpalette.map.txt",
61 },
62 linux_glibc: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070063 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000064 srcs: ["system/palette_fake.cc"],
65 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070066 shared_libs: [
67 "libbase",
68 "liblog",
69 ],
Orion Hodson119733d2019-01-30 15:14:41 +000070 },
71 version_script: "libartpalette.map.txt",
72 },
73 // Targets without support for dlopen just use the sources for
74 // the system library which actually implements functionality.
75 darwin: {
76 enabled: true,
77 header_libs: ["libbase_headers"],
78 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010079 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070080 "libbase",
81 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010082 ],
Orion Hodson119733d2019-01-30 15:14:41 +000083 },
84 windows: {
85 enabled: true,
86 header_libs: ["libbase_headers"],
87 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010088 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070089 "libbase",
90 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010091 ],
Orion Hodson119733d2019-01-30 15:14:41 +000092 },
Andreas Gampe0dc93b12019-05-15 10:30:22 -070093 },
Jiyong Park066dd9022019-12-19 02:11:59 +000094 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010095 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +000096 "com.android.art.debug",
Jiyong Park7c2f69e2020-01-15 15:43:32 +090097 // TODO(b/142944931): remove this
98 "com.android.runtime", // due to the transitive dependency from linker
Jiyong Park066dd9022019-12-19 02:11:59 +000099 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000100}
101
102art_cc_test {
103 name: "art_libartpalette_tests",
104 defaults: ["art_gtest_defaults"],
105 host_supported: true,
106 srcs: ["apex/palette_test.cc"],
107 shared_libs: ["libartpalette"],
Orion Hodson119733d2019-01-30 15:14:41 +0000108}