blob: 63abfe2024fe8fa623706d33e7c04a803070455b [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,
28 visibility: ["//system/libartpalette"],
Orion Hodson119733d2019-01-30 15:14:41 +000029}
30
31// libartpalette is the dynamic loader of the platform abstraction
32// layer. It is only used on Android. For other targets, it just
33// implements a fake platform implementation.
34art_cc_library {
35 name: "libartpalette",
36 defaults: ["libartpalette_defaults"],
Andreas Gampe0dc93b12019-05-15 10:30:22 -070037 required: ["libartpalette-system"], // libartpalette.so dlopen()'s libartpalette-system.
Orion Hodson119733d2019-01-30 15:14:41 +000038 header_libs: ["libbase_headers"],
39 target: {
40 // Targets supporting dlopen build the client library which loads
41 // and binds the methods in the libartpalette-system library.
42 android: {
43 srcs: ["apex/palette.cc"],
Jiyong Park1926f2e2020-03-11 10:21:49 +090044 shared_libs: ["liblog"],
Orion Hodson119733d2019-01-30 15:14:41 +000045 version_script: "libartpalette.map.txt",
46 },
47 linux_bionic: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070048 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000049 srcs: ["system/palette_fake.cc"],
50 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070051 shared_libs: [
52 "libbase",
53 "liblog",
54 ],
Orion Hodson119733d2019-01-30 15:14:41 +000055 },
56 version_script: "libartpalette.map.txt",
57 },
58 linux_glibc: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070059 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000060 srcs: ["system/palette_fake.cc"],
61 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070062 shared_libs: [
63 "libbase",
64 "liblog",
65 ],
Orion Hodson119733d2019-01-30 15:14:41 +000066 },
67 version_script: "libartpalette.map.txt",
68 },
69 // Targets without support for dlopen just use the sources for
70 // the system library which actually implements functionality.
71 darwin: {
72 enabled: true,
73 header_libs: ["libbase_headers"],
74 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010075 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070076 "libbase",
77 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010078 ],
Orion Hodson119733d2019-01-30 15:14:41 +000079 },
80 windows: {
81 enabled: true,
82 header_libs: ["libbase_headers"],
83 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010084 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070085 "libbase",
86 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010087 ],
Orion Hodson119733d2019-01-30 15:14:41 +000088 },
Andreas Gampe0dc93b12019-05-15 10:30:22 -070089 },
Jiyong Park066dd9022019-12-19 02:11:59 +000090 apex_available: [
91 "com.android.art.release",
92 "com.android.art.debug",
Jiyong Park7c2f69e2020-01-15 15:43:32 +090093 // TODO(b/142944931): remove this
94 "com.android.runtime", // due to the transitive dependency from linker
Jiyong Park066dd9022019-12-19 02:11:59 +000095 // TODO(b/142944931) Clean this up. This is due to the dependency to libdexfile_support_static
96 // from /system/core, etc.
97 "//apex_available:platform",
98 ],
Orion Hodson119733d2019-01-30 15:14:41 +000099}
100
101art_cc_test {
102 name: "art_libartpalette_tests",
103 defaults: ["art_gtest_defaults"],
104 host_supported: true,
105 srcs: ["apex/palette_test.cc"],
106 shared_libs: ["libartpalette"],
107 test_per_src: true,
108}