1 // 2 // Copyright (C) 2017 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 subdirs = [ 17 "common", 18 "guest", 19 "host", 20 ] 21 22 cc_library_headers { 23 name: "cuttlefish_common_headers", 24 vendor: true, 25 export_include_dirs: ["."], 26 host_supported: true, 27 } 28 29 // TODO(b/67435044) Update the include paths and remove this 30 cc_library_headers { 31 name: "cuttlefish_glog", 32 vendor: true, 33 export_include_dirs: ["common/libs"], 34 host_supported: true, 35 } 36 37 cc_defaults { 38 name: "cuttlefish_base", 39 gnu_extensions: false, 40 header_libs: [ 41 "cuttlefish_common_headers", 42 "cuttlefish_kernel_headers", 43 "cuttlefish_shared_config", 44 ], 45 target: { 46 host: { 47 host_ldlibs: ["-lrt"], 48 cflags: ["-DCUTTLEFISH_HOST"], 49 compile_multilib: "64", 50 }, 51 // We don't need Darwin host-side builds 52 darwin: { 53 enabled: false, 54 }, 55 }, 56 cflags: ["-Werror", "-Wall"], 57 vendor: true, 58 } 59 60 cc_defaults { 61 name: "cuttlefish_guest_only", 62 defaults: ["cuttlefish_base"], 63 } 64 65 cc_defaults { 66 name: "cuttlefish_host_only", 67 device_supported: false, 68 host_supported: true, 69 defaults: ["cuttlefish_base"], 70 } 71 72 cc_defaults { 73 name: "cuttlefish_host_and_guest", 74 host_supported: true, 75 defaults: ["cuttlefish_base"], 76 } 77 78 cc_library_shared { 79 name: "vsoc_lib", 80 srcs: [ 81 "common/vsoc/lib/compat.cpp", 82 "common/vsoc/lib/audio_data_layout.cpp", 83 "common/vsoc/lib/e2e_test_region_layout.cpp", 84 "common/vsoc/lib/gralloc_layout.cpp", 85 "common/vsoc/lib/input_events_layout.cpp", 86 "common/vsoc/lib/input_events_region_view.cpp", 87 "common/vsoc/lib/lock_common.cpp", 88 "common/vsoc/lib/managed_e2e_test_region_layout.cpp", 89 "common/vsoc/lib/region_view.cpp", 90 "common/vsoc/lib/screen_layout.cpp", 91 "common/vsoc/lib/screen_region_view.cpp", 92 "common/vsoc/lib/socket_forward_layout.cpp", 93 "common/vsoc/lib/socket_forward_region_view.cpp", 94 "common/vsoc/lib/vsoc_memory.cpp", 95 ], 96 header_libs: ["cuttlefish_glog"], 97 shared_libs: [ 98 "libcuttlefish_fs", 99 "cuttlefish_auto_resources", 100 "libbase", 101 "liblog", 102 ], 103 target: { 104 host: { 105 srcs: [ 106 "host/vsoc/lib/gralloc_buffer_region_view.cpp", 107 "host/vsoc/lib/host_lock.cpp", 108 "host/vsoc/lib/region_control.cpp", 109 "host/vsoc/lib/region_view.cpp", 110 ], 111 }, 112 android: { 113 srcs: [ 114 "guest/vsoc/lib/gralloc_region_view.cpp", 115 "guest/vsoc/lib/guest_lock.cpp", 116 "guest/vsoc/lib/region_control.cpp", 117 "guest/vsoc/lib/region_view.cpp", 118 ], 119 }, 120 }, 121 defaults: ["cuttlefish_host_and_guest"], 122 } 123 124 cc_test_host { 125 name: "circqueue_test", 126 srcs: [ 127 "common/vsoc/lib/circqueue_test.cpp", 128 ], 129 shared_libs: [ 130 "vsoc_lib", 131 "libbase", 132 ], 133 defaults: ["cuttlefish_host_only"], 134 } 135 136 cc_binary_host { 137 name: "vsoc_screen_region_view_test", 138 srcs: [ 139 "common/vsoc/lib/screen_region_view_test.cpp", 140 ], 141 static_libs: [ 142 "libcuttlefish_host_config", 143 "libjsoncpp", 144 "libgflags", 145 ], 146 shared_libs: [ 147 "vsoc_lib", 148 "libbase", 149 "libcuttlefish_utils", 150 ], 151 defaults: ["cuttlefish_host_only"], 152 } 153 154 cc_test_host { 155 name: "lock_test", 156 srcs: [ 157 "common/vsoc/lib/lock_test.cpp", 158 ], 159 shared_libs: [ 160 "vsoc_lib", 161 "libcuttlefish_fs", 162 "cuttlefish_auto_resources", 163 "libbase", 164 ], 165 static_libs: [ 166 "libgtest_host", 167 ], 168 defaults: ["cuttlefish_host_only"], 169 } 170 171 cc_test_host { 172 name: "vsoc_graphics_test", 173 srcs: [ 174 "common/vsoc/lib/graphics_test.cpp", 175 ], 176 shared_libs: [ 177 "vsoc_lib", 178 "libbase", 179 ], 180 defaults: ["cuttlefish_host_only"], 181 } 182 183 cc_binary_host { 184 name: "host_region_e2e_test", 185 srcs: [ 186 "host/vsoc/lib/host_region_e2e_test.cpp", 187 ], 188 shared_libs: [ 189 "vsoc_lib", 190 "libcuttlefish_fs", 191 "libcuttlefish_utils", 192 "cuttlefish_auto_resources", 193 "libbase", 194 ], 195 static_libs: [ 196 "libcuttlefish_host_config", 197 "libjsoncpp", 198 "libgtest_host", 199 "libgflags", 200 ], 201 defaults: ["cuttlefish_host_only"], 202 } 203