1// 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 17package { 18 // See: http://go/android-license-faq 19 // A large-scale-change added 'default_applicable_licenses' to import 20 // all of the 'license_kinds' from "art_license" 21 // to get the below license kinds: 22 // SPDX-license-identifier-Apache-2.0 23 default_applicable_licenses: ["art_license"], 24 default_team: "trendy_team_art_mainline", 25} 26 27cc_defaults { 28 name: "libartpalette_defaults", 29 defaults: ["art_defaults"], 30 host_supported: true, 31 export_include_dirs: ["include"], 32} 33 34cc_library_headers { 35 name: "libartpalette-headers", 36 export_include_dirs: ["include"], 37 host_supported: true, 38 visibility: [ 39 "//art:__subpackages__", 40 "//system/libartpalette", 41 ], 42} 43 44// libartpalette is the dynamic loader of the platform abstraction 45// layer. It is only used on Android. For other targets, it just 46// implements a fake platform implementation. 47art_cc_library { 48 name: "libartpalette", 49 defaults: ["libartpalette_defaults"], 50 visibility: [ 51 // TODO(b/183483755): Please visibility checks when the prebuilt 52 // libartpalette is present but not preferred, and the prebuilt 53 // libdexfile hence depends on the source instead. 54 // TODO(b/172480617): Alternatively, clean up when we no longer need to 55 // support both prebuilts and sources present simultaneously. 56 "//prebuilts/module_sdk/art:__subpackages__", 57 ], 58 header_libs: [ 59 "libbase_headers", 60 "jni_headers", 61 ], 62 export_header_lib_headers: [ 63 "jni_headers", 64 ], 65 target: { 66 // Targets supporting dlopen build the client library which loads 67 // and binds the methods in the libartpalette-system library. 68 android: { 69 // libartpalette.so dlopen()'s libartpalette-system. 70 runtime_libs: ["libartpalette-system"], 71 srcs: ["apex/palette.cc"], 72 shared_libs: ["liblog"], 73 version_script: "libartpalette.map", 74 }, 75 host_linux: { 76 header_libs: ["libbase_headers"], 77 srcs: ["system/palette_fake.cc"], 78 shared: { 79 shared_libs: [ 80 "libbase", 81 "liblog", 82 ], 83 }, 84 version_script: "libartpalette.map", 85 }, 86 // Targets without support for dlopen just use the sources for 87 // the system library which actually implements functionality. 88 darwin: { 89 enabled: true, 90 header_libs: ["libbase_headers"], 91 srcs: ["system/palette_fake.cc"], 92 static_libs: [ 93 "libbase", 94 "liblog", 95 ], 96 }, 97 windows: { 98 enabled: true, 99 header_libs: ["libbase_headers"], 100 srcs: ["system/palette_fake.cc"], 101 static_libs: [ 102 "libbase", 103 "liblog", 104 ], 105 }, 106 }, 107 apex_available: [ 108 "com.android.art", 109 "com.android.art.debug", 110 // TODO(b/142944931): remove this 111 "com.android.runtime", // due to the transitive dependency from linker 112 ], 113} 114 115art_cc_defaults { 116 name: "art_libartpalette_tests_defaults", 117 srcs: ["apex/palette_test.cc"], 118 target: { 119 android: { 120 static_libs: ["libmodules-utils-build"], 121 }, 122 }, 123} 124 125// Version of ART gtest `art_libartpalette_tests` bundled with the ART APEX on target. 126// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. 127art_cc_test { 128 name: "art_libartpalette_tests", 129 defaults: [ 130 "art_gtest_defaults", 131 "art_libartpalette_tests_defaults", 132 ], 133 host_supported: true, 134} 135 136// Standalone version of ART gtest `art_libartpalette_tests`, not bundled with the ART APEX on 137// target. 138art_cc_test { 139 name: "art_standalone_libartpalette_tests", 140 team: "trendy_team_art_performance", 141 defaults: [ 142 "art_standalone_gtest_defaults", 143 "art_libartpalette_tests_defaults", 144 ], 145 test_config_template: ":art-gtests-target-standalone-cts-template", 146 test_suites: [ 147 "cts", 148 "mcts-art", 149 ], 150} 151