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