blob: f6c7ac168ae51ca345ed34db4a0abb964573f15e [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
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"],
Orion Hodson6a06cd82019-02-20 09:34:35 +000029 compile_multilib: "both",
Orion Hodson119733d2019-01-30 15:14:41 +000030 target: {
31 android: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070032 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 ],
Orion Hodson119733d2019-01-30 15:14:41 +000041 },
42 host: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070043 header_libs: ["libbase_headers"],
44 srcs: ["system/palette_fake.cc"],
45 shared_libs: ["libbase"],
Orion Hodson119733d2019-01-30 15:14:41 +000046 },
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"],
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +010066 visibility: [
67 // TODO(b/133140750): Clean this up.
68 "//frameworks/base/startop/view_compiler",
69 "//system/extras/simpleperf",
70 ],
Andreas Gampe0dc93b12019-05-15 10:30:22 -070071 required: ["libartpalette-system"], // libartpalette.so dlopen()'s libartpalette-system.
Orion Hodson119733d2019-01-30 15:14:41 +000072 header_libs: ["libbase_headers"],
73 target: {
74 // Targets supporting dlopen build the client library which loads
75 // and binds the methods in the libartpalette-system library.
76 android: {
77 srcs: ["apex/palette.cc"],
78 shared: {
79 shared_libs: ["liblog"],
80 },
81 static: {
82 static_libs: ["liblog"],
83 },
84 version_script: "libartpalette.map.txt",
85 },
86 linux_bionic: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070087 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000088 srcs: ["system/palette_fake.cc"],
89 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070090 shared_libs: [
91 "libbase",
92 "liblog",
93 ],
Orion Hodson119733d2019-01-30 15:14:41 +000094 },
95 version_script: "libartpalette.map.txt",
96 },
97 linux_glibc: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070098 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000099 srcs: ["system/palette_fake.cc"],
100 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700101 shared_libs: [
102 "libbase",
103 "liblog",
104 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000105 },
106 version_script: "libartpalette.map.txt",
107 },
108 // Targets without support for dlopen just use the sources for
109 // the system library which actually implements functionality.
110 darwin: {
111 enabled: true,
112 header_libs: ["libbase_headers"],
113 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +0100114 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700115 "libbase",
116 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +0100117 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000118 },
119 windows: {
120 enabled: true,
121 header_libs: ["libbase_headers"],
122 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +0100123 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700124 "libbase",
125 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +0100126 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000127 },
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700128 },
Orion Hodson119733d2019-01-30 15:14:41 +0000129}
130
131art_cc_test {
132 name: "art_libartpalette_tests",
133 defaults: ["art_gtest_defaults"],
134 host_supported: true,
135 srcs: ["apex/palette_test.cc"],
136 shared_libs: ["libartpalette"],
137 test_per_src: true,
138}