blob: 2fe4cc611818c3704674c75d71cacb3d9e1ca3d0 [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"],
44 shared: {
45 shared_libs: ["liblog"],
46 },
47 static: {
48 static_libs: ["liblog"],
49 },
50 version_script: "libartpalette.map.txt",
51 },
52 linux_bionic: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070053 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000054 srcs: ["system/palette_fake.cc"],
55 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070056 shared_libs: [
57 "libbase",
58 "liblog",
59 ],
Orion Hodson119733d2019-01-30 15:14:41 +000060 },
61 version_script: "libartpalette.map.txt",
62 },
63 linux_glibc: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070064 header_libs: ["libbase_headers"],
Orion Hodson119733d2019-01-30 15:14:41 +000065 srcs: ["system/palette_fake.cc"],
66 shared: {
Andreas Gampe0dc93b12019-05-15 10:30:22 -070067 shared_libs: [
68 "libbase",
69 "liblog",
70 ],
Orion Hodson119733d2019-01-30 15:14:41 +000071 },
72 version_script: "libartpalette.map.txt",
73 },
74 // Targets without support for dlopen just use the sources for
75 // the system library which actually implements functionality.
76 darwin: {
77 enabled: true,
78 header_libs: ["libbase_headers"],
79 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010080 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070081 "libbase",
82 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010083 ],
Orion Hodson119733d2019-01-30 15:14:41 +000084 },
85 windows: {
86 enabled: true,
87 header_libs: ["libbase_headers"],
88 srcs: ["system/palette_fake.cc"],
Orion Hodsond3374a02019-05-02 10:56:33 +010089 static_libs: [
Andreas Gampe0dc93b12019-05-15 10:30:22 -070090 "libbase",
91 "liblog",
Orion Hodsond3374a02019-05-02 10:56:33 +010092 ],
Orion Hodson119733d2019-01-30 15:14:41 +000093 },
Andreas Gampe0dc93b12019-05-15 10:30:22 -070094 },
Jiyong Park066dd9022019-12-19 02:11:59 +000095 apex_available: [
96 "com.android.art.release",
97 "com.android.art.debug",
98 // TODO(b/142944931) Clean this up. This is due to the dependency to libdexfile_support_static
99 // from /system/core, etc.
100 "//apex_available:platform",
101 ],
Orion Hodson119733d2019-01-30 15:14:41 +0000102}
103
104art_cc_test {
105 name: "art_libartpalette_tests",
106 defaults: ["art_gtest_defaults"],
107 host_supported: true,
108 srcs: ["apex/palette_test.cc"],
109 shared_libs: ["libartpalette"],
110 test_per_src: true,
111}