Greg Hartman | bff7e63 | 2017-09-29 11:32:08 -0700 | [diff] [blame] | 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", |
Tomasz Wiszkowski | eb642fc | 2017-11-28 12:36:31 -0800 | [diff] [blame] | 18 | "guest", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 19 | "host", |
Greg Hartman | bff7e63 | 2017-09-29 11:32:08 -0700 | [diff] [blame] | 20 | ] |
| 21 | |
| 22 | cc_library_headers { |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 23 | name: "cuttlefish_common_headers", |
Isaac Chen | fef21be | 2017-12-11 16:57:33 +0800 | [diff] [blame] | 24 | vendor: true, |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 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", |
Isaac Chen | fef21be | 2017-12-11 16:57:33 +0800 | [diff] [blame] | 32 | vendor: true, |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 33 | export_include_dirs: ["common/libs"], |
| 34 | host_supported: true, |
Greg Hartman | bff7e63 | 2017-09-29 11:32:08 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | cc_defaults { |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 38 | name: "cuttlefish_base", |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame] | 39 | gnu_extensions: false, |
| 40 | header_libs: [ |
| 41 | "cuttlefish_common_headers", |
| 42 | "cuttlefish_kernel_headers", |
| 43 | ], |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame] | 44 | target: { |
| 45 | linux: { |
| 46 | host_ldlibs: ["-lrt"], |
| 47 | cflags: ["-DCUTTLEFISH_HOST"], |
| 48 | }, |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 49 | // We don't need 32 bit host-side builds |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 50 | linux_x86: { |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame] | 51 | enabled: false, |
| 52 | }, |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 53 | // We don't need Darwin host-side builds |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 54 | darwin: { |
| 55 | enabled: false, |
| 56 | }, |
Greg Hartman | bff7e63 | 2017-09-29 11:32:08 -0700 | [diff] [blame] | 57 | }, |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 58 | vendor: true, |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 59 | } |
| 60 | |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 61 | // ARM code should not touch the VSoC window on an x86 CPU. |
Greg Hartman | 98d18af | 2017-12-05 13:12:31 -0800 | [diff] [blame] | 62 | cc_defaults { |
Greg Hartman | 6da4302 | 2017-12-05 11:16:02 -0800 | [diff] [blame] | 63 | name: "cuttlefish_native_isa", |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 64 | target: { |
Greg Hartman | 98d18af | 2017-12-05 13:12:31 -0800 | [diff] [blame] | 65 | android_arm: { |
| 66 | enabled: false, |
| 67 | }, |
Greg Hartman | ab9caea | 2017-12-08 19:49:14 -0800 | [diff] [blame] | 68 | android_arm64: { |
| 69 | enabled: false, |
| 70 | }, |
Greg Hartman | 98d18af | 2017-12-05 13:12:31 -0800 | [diff] [blame] | 71 | }, |
| 72 | } |
| 73 | |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 74 | cc_defaults { |
| 75 | name: "cuttlefish_host_only", |
| 76 | device_supported: false, |
| 77 | host_supported: true, |
| 78 | defaults: ["cuttlefish_base"], |
| 79 | } |
| 80 | |
| 81 | cc_defaults { |
| 82 | name: "cuttlefish_host_and_guest", |
| 83 | host_supported: true, |
| 84 | defaults: ["cuttlefish_base"], |
| 85 | } |
| 86 | |
| 87 | cc_library_shared { |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 88 | name: "vsoc_lib", |
| 89 | srcs: [ |
| 90 | "common/vsoc/lib/compat.cpp", |
| 91 | "common/vsoc/lib/e2e_test_region_layout.cpp", |
| 92 | "common/vsoc/lib/fb_bcast_layout.cpp", |
Greg Hartman | 4cbb6ab | 2017-12-04 18:31:37 -0800 | [diff] [blame] | 93 | "common/vsoc/lib/fb_bcast_region_view.cpp", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 94 | "common/vsoc/lib/gralloc_layout.cpp", |
| 95 | "common/vsoc/lib/lock_common.cpp", |
| 96 | "common/vsoc/lib/region_view.cpp", |
Tomasz Wiszkowski | c2c4dd6 | 2017-11-30 10:19:22 -0800 | [diff] [blame] | 97 | "common/vsoc/lib/wifi_exchange_layout.cpp", |
Tomasz Wiszkowski | 719ce86 | 2017-12-01 12:31:17 -0800 | [diff] [blame] | 98 | "common/vsoc/lib/wifi_exchange_view.cpp", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 99 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 100 | header_libs: ["cuttlefish_glog"], |
| 101 | shared_libs: [ |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 102 | "libcuttlefish_fs", |
Greg Hartman | 98d18af | 2017-12-05 13:12:31 -0800 | [diff] [blame] | 103 | "cuttlefish_auto_resources", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 104 | "libbase", |
Greg Hartman | d072a34 | 2017-12-05 20:27:40 -0800 | [diff] [blame] | 105 | "liblog", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 106 | ], |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame] | 107 | target: { |
| 108 | linux: { |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame] | 109 | srcs: [ |
Greg Hartman | d072a34 | 2017-12-05 20:27:40 -0800 | [diff] [blame] | 110 | "host/vsoc/lib/gralloc_buffer_region_view.cpp", |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame] | 111 | "host/vsoc/lib/host_lock.cpp", |
| 112 | "host/vsoc/lib/region_control.cpp", |
| 113 | "host/vsoc/lib/region_view.cpp", |
| 114 | ], |
| 115 | }, |
| 116 | android: { |
| 117 | srcs: [ |
Greg Hartman | d072a34 | 2017-12-05 20:27:40 -0800 | [diff] [blame] | 118 | "guest/vsoc/lib/gralloc_region_view.cpp", |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame] | 119 | "guest/vsoc/lib/guest_lock.cpp", |
| 120 | "guest/vsoc/lib/region_control.cpp", |
| 121 | "guest/vsoc/lib/region_view.cpp", |
| 122 | ], |
| 123 | }, |
| 124 | }, |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 125 | defaults: ["cuttlefish_host_and_guest", "cuttlefish_native_isa"], |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 126 | } |
| 127 | |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 128 | cc_test_host { |
| 129 | name: "circqueue_test", |
| 130 | srcs: [ |
| 131 | "common/vsoc/lib/circqueue_test.cpp", |
| 132 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 133 | shared_libs: [ |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 134 | "vsoc_lib", |
| 135 | "libbase", |
| 136 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 137 | defaults: ["cuttlefish_host_only"], |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 138 | } |
| 139 | |
Greg Hartman | 4cbb6ab | 2017-12-04 18:31:37 -0800 | [diff] [blame] | 140 | cc_test { |
| 141 | name: "vsoc_fb_bcast_region_view_test", |
| 142 | srcs: [ |
| 143 | "common/vsoc/lib/fb_bcast_region_view_test.cpp", |
| 144 | ], |
| 145 | shared_libs: [ |
| 146 | "vsoc_lib", |
| 147 | "libbase", |
| 148 | ], |
| 149 | target : { |
| 150 | linux_x86_64: { |
| 151 | static_libs: [ |
| 152 | "libcuttlefish_host_config", |
| 153 | "libgflags", |
| 154 | ], |
| 155 | }, |
| 156 | }, |
| 157 | defaults: ["cuttlefish_host_and_guest", "cuttlefish_native_isa"], |
| 158 | } |
| 159 | |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 160 | cc_test_host { |
| 161 | name: "lock_test", |
| 162 | srcs: [ |
| 163 | "common/vsoc/lib/lock_test.cpp", |
| 164 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 165 | shared_libs: [ |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 166 | "vsoc_lib", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 167 | "libcuttlefish_fs", |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 168 | "cuttlefish_auto_resources", |
| 169 | "libbase", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 170 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 171 | static_libs: [ |
| 172 | "libgtest_host", |
| 173 | ], |
| 174 | defaults: ["cuttlefish_host_only"], |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | cc_test_host { |
| 178 | name: "vsoc_graphics_test", |
| 179 | srcs: [ |
| 180 | "common/vsoc/lib/graphics_test.cpp", |
| 181 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 182 | shared_libs: [ |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 183 | "vsoc_lib", |
| 184 | "libbase", |
| 185 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 186 | defaults: ["cuttlefish_host_only"], |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | cc_binary_host { |
| 190 | name: "host_region_e2e_test", |
| 191 | srcs: [ |
| 192 | "host/vsoc/lib/host_region_e2e_test.cpp", |
| 193 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 194 | shared_libs: [ |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 195 | "vsoc_lib", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 196 | "libcuttlefish_fs", |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 197 | "cuttlefish_auto_resources", |
| 198 | "libbase", |
| 199 | ], |
| 200 | static_libs: [ |
Greg Hartman | 6da4302 | 2017-12-05 11:16:02 -0800 | [diff] [blame] | 201 | "libcuttlefish_host_config", |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 202 | "libgtest_host", |
Tomasz Wiszkowski | c2c4dd6 | 2017-11-30 10:19:22 -0800 | [diff] [blame] | 203 | "libgflags", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 204 | ], |
Greg Hartman | ce872ef | 2017-12-04 22:51:47 -0800 | [diff] [blame] | 205 | defaults: ["cuttlefish_host_only"], |
Greg Hartman | bff7e63 | 2017-09-29 11:32:08 -0700 | [diff] [blame] | 206 | } |