blob: 0a45b8880b78757a10bfe43cb963edd7b9c49b68 [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"],
Andreas Gampe0dc93b12019-05-15 10:30:22 -070066 required: ["libartpalette-system"], // libartpalette.so dlopen()'s libartpalette-system.
Orion Hodson119733d2019-01-30 15:14:41 +000067 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: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070082 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000083 srcs: ["system/palette_fake.cc"],
84 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070085 shared_libs: [
86 "libbase",
87 "liblog",
88 ],
Orion Hodson119733d2019-01-30 15:14:41 +000089 },
90 version_script: "libartpalette.map.txt",
91 },
92 linux_glibc: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070093 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000094 srcs: ["system/palette_fake.cc"],
95 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070096 shared_libs: [
97 "libbase",
98 "liblog",
99 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000100 },
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"],
Orion Hodsond3374a02019-05-02 10:56:33 +0100109 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700110 "libbase",
111 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +0100112 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000113 },
114 windows: {
115 enabled: true,
116 header_libs: ["libbase_headers"],
117 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +0100118 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700119 "libbase",
120 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +0100121 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000122 },
Andreas Gampe0dc93b12019-05-15 10:30:22 -0700123 },
Orion Hodson119733d2019-01-30 15:14:41 +0000124}
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}