blob: 5a3e986898ff39ce2cd62f6920c96d08167a5c32 [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 {
18 name: "libartpalette_defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
21 export_include_dirs: ["include"],
22}
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: {
32 srcs: ["system/palette_android.cc",],
33 header_libs: ["libbase_headers"],
34 shared_libs: [
Martin Stjernholm2e2c45e2019-04-09 20:40:59 +010035 "libbase",
Orion Hodson119733d2019-01-30 15:14:41 +000036 "libcutils",
37 "liblog",
38 "libprocessgroup",
Martin Stjernholm2e2c45e2019-04-09 20:40:59 +010039 "libtombstoned_client",
Orion Hodson119733d2019-01-30 15:14:41 +000040 ],
41 },
42 host: {
43 header_libs: ["libbase_headers"],
44 srcs: ["system/palette_fake.cc",],
Orion Hodsond3374a02019-05-02 10:56:33 +010045 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"],
66 required: ["libartpalette-system"], // libartpalette.so dlopen()'s libartpalette-system.
67 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: {
82 header_libs: ["libbase_headers"],
83 srcs: ["system/palette_fake.cc"],
84 shared: {
Orion Hodsond3374a02019-05-02 10:56:33 +010085 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: {
93 header_libs: ["libbase_headers"],
94 srcs: ["system/palette_fake.cc"],
95 shared: {
Orion Hodsond3374a02019-05-02 10:56:33 +010096 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: [
110 "libbase",
111 "liblog"
112 ],
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: [
119 "libbase",
120 "liblog"
121 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000122 },
123 }
124}
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}