blob: 1ccc5e409d6c0161cff342a798f2bae947aa2e7f [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"],
Martin Stjernholm75b961a2020-05-07 01:45:27 +010020 visibility: [
21 // Visibility for prebuilt binaries from the prebuilt of this module.
22 // TODO(b/155921753): Restrict this when prebuilts are in their proper
23 // locations.
24 "//prebuilts:__subpackages__",
25 ],
Andreas Gampe0dc93b12019-05-15 10:30:22 -070026 host_supported: true,
27 export_include_dirs: ["include"],
Orion Hodson119733d2019-01-30 15:14:41 +000028}
29
Orion Hodsonc8315d92019-11-01 13:02:02 +000030cc_library_headers {
31 name: "libartpalette-headers",
32 export_include_dirs: ["include"],
33 host_supported: true,
34 visibility: ["//system/libartpalette"],
Orion Hodson119733d2019-01-30 15:14:41 +000035}
36
37// libartpalette is the dynamic loader of the platform abstraction
38// layer. It is only used on Android. For other targets, it just
39// implements a fake platform implementation.
40art_cc_library {
41 name: "libartpalette",
42 defaults: ["libartpalette_defaults"],
Orion Hodson119733d2019-01-30 15:14:41 +000043 header_libs: ["libbase_headers"],
44 target: {
45 // Targets supporting dlopen build the client library which loads
46 // and binds the methods in the libartpalette-system library.
47 android: {
Yo Chiang4c045142020-05-26 17:37:49 +080048 // libartpalette.so dlopen()'s libartpalette-system.
49 required: ["libartpalette-system"],
Orion Hodson119733d2019-01-30 15:14:41 +000050 srcs: ["apex/palette.cc"],
Jiyong Park1926f2e2020-03-11 10:21:49 +090051 shared_libs: ["liblog"],
Orion Hodson119733d2019-01-30 15:14:41 +000052 version_script: "libartpalette.map.txt",
53 },
54 linux_bionic: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070055 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000056 srcs: ["system/palette_fake.cc"],
57 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070058 shared_libs: [
59 "libbase",
60 "liblog",
61 ],
Orion Hodson119733d2019-01-30 15:14:41 +000062 },
63 version_script: "libartpalette.map.txt",
64 },
65 linux_glibc: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070066 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000067 srcs: ["system/palette_fake.cc"],
68 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070069 shared_libs: [
70 "libbase",
71 "liblog",
72 ],
Orion Hodson119733d2019-01-30 15:14:41 +000073 },
74 version_script: "libartpalette.map.txt",
75 },
76 // Targets without support for dlopen just use the sources for
77 // the system library which actually implements functionality.
78 darwin: {
79 enabled: true,
80 header_libs: ["libbase_headers"],
81 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010082 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070083 "libbase",
84 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010085 ],
Orion Hodson119733d2019-01-30 15:14:41 +000086 },
87 windows: {
88 enabled: true,
89 header_libs: ["libbase_headers"],
90 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010091 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070092 "libbase",
93 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010094 ],
Orion Hodson119733d2019-01-30 15:14:41 +000095 },
Andreas Gampe0dc93b12019-05-15 10:30:22 -070096 },
Jiyong Park066dd9022019-12-19 02:11:59 +000097 apex_available: [
98 "com.android.art.release",
99 "com.android.art.debug",
Jiyong Park7c2f69e2020-01-15 15:43:32 +0900100 // TODO(b/142944931): remove this
101 "com.android.runtime", // due to the transitive dependency from linker
Jiyong Park066dd9022019-12-19 02:11:59 +0000102 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000103}
104
105art_cc_test {
106 name: "art_libartpalette_tests",
107 defaults: ["art_gtest_defaults"],
108 host_supported: true,
109 srcs: ["apex/palette_test.cc"],
110 shared_libs: ["libartpalette"],
Orion Hodson119733d2019-01-30 15:14:41 +0000111}