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 { |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame^] | 36 | name: "cuttlefish_common", |
| 37 | gnu_extensions: false, |
| 38 | header_libs: [ |
| 39 | "cuttlefish_common_headers", |
| 40 | "cuttlefish_kernel_headers", |
| 41 | ], |
| 42 | host_supported: true, |
| 43 | device_supported: true, |
| 44 | target: { |
| 45 | linux: { |
| 46 | host_ldlibs: ["-lrt"], |
| 47 | cflags: ["-DCUTTLEFISH_HOST"], |
| 48 | }, |
| 49 | darwin: { |
| 50 | enabled: false, |
| 51 | }, |
| 52 | android: { |
| 53 | enabled: true, |
| 54 | }, |
| 55 | windows: { |
| 56 | enabled: false, |
| 57 | }, |
| 58 | }, |
| 59 | } |
| 60 | |
| 61 | cc_defaults { |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 62 | name: "cuttlefish_host", |
| 63 | gnu_extensions: false, |
| 64 | header_libs: [ |
| 65 | "cuttlefish_common_headers", |
| 66 | "cuttlefish_kernel_headers", |
| 67 | ], |
| 68 | // Build only 64 bit Intel Linux host executables |
| 69 | device_supported: false, |
| 70 | compile_multilib: "64", |
| 71 | target: { |
| 72 | linux: { |
| 73 | host_ldlibs: ["-lrt"], |
| 74 | cflags: ["-DCUTTLEFISH_HOST"], |
| 75 | }, |
| 76 | darwin: { |
| 77 | enabled: false, |
| 78 | }, |
Greg Hartman | bff7e63 | 2017-09-29 11:32:08 -0700 | [diff] [blame] | 79 | }, |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 80 | } |
| 81 | |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame^] | 82 | cc_library { |
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", |
| 88 | "common/vsoc/lib/gralloc_layout.cpp", |
| 89 | "common/vsoc/lib/lock_common.cpp", |
| 90 | "common/vsoc/lib/region_view.cpp", |
Tomasz Wiszkowski | c2c4dd6 | 2017-11-30 10:19:22 -0800 | [diff] [blame] | 91 | "common/vsoc/lib/wifi_exchange_layout.cpp", |
Tomasz Wiszkowski | 719ce86 | 2017-12-01 12:31:17 -0800 | [diff] [blame] | 92 | "common/vsoc/lib/wifi_exchange_view.cpp", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 93 | ], |
Tomasz Wiszkowski | 55d53ff | 2017-12-04 15:39:57 -0800 | [diff] [blame^] | 94 | header_libs: [ |
| 95 | "cuttlefish_glog" |
| 96 | ], |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 97 | static_libs: [ |
| 98 | "libcuttlefish_fs", |
| 99 | "libbase", |
Tomasz Wiszkowski | c2c4dd6 | 2017-11-30 10:19:22 -0800 | [diff] [blame] | 100 | "libgflags", |
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: { |
| 103 | linux: { |
| 104 | host_ldlibs: ["-lrt"], |
| 105 | cflags: ["-DCUTTLEFISH_HOST"], |
| 106 | srcs: [ |
| 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/guest_lock.cpp", |
| 115 | "guest/vsoc/lib/region_control.cpp", |
| 116 | "guest/vsoc/lib/region_view.cpp", |
| 117 | ], |
| 118 | }, |
| 119 | }, |
| 120 | defaults: ["cuttlefish_common"], |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | cc_library_host_static { |
| 124 | name: "libvsoc_gralloc", |
| 125 | srcs: [ |
| 126 | "host/vsoc/gralloc/gralloc_buffer_region.cpp", |
| 127 | ], |
| 128 | header_libs: ["cuttlefish_glog"], |
| 129 | static_libs: [ |
| 130 | "vsoc_lib", |
| 131 | "libbase", |
| 132 | ], |
| 133 | defaults: ["cuttlefish_host"], |
| 134 | } |
| 135 | |
| 136 | cc_test_host { |
| 137 | name: "circqueue_test", |
| 138 | srcs: [ |
| 139 | "common/vsoc/lib/circqueue_test.cpp", |
| 140 | ], |
| 141 | static_libs: [ |
| 142 | "vsoc_lib", |
| 143 | "libbase", |
| 144 | ], |
| 145 | defaults: ["cuttlefish_host"], |
| 146 | } |
| 147 | |
| 148 | cc_test_host { |
| 149 | name: "lock_test", |
| 150 | srcs: [ |
| 151 | "common/vsoc/lib/lock_test.cpp", |
| 152 | ], |
| 153 | static_libs: [ |
| 154 | "vsoc_lib", |
| 155 | "libgtest_host", |
| 156 | "libbase", |
| 157 | "cuttlefish_auto_resources", |
| 158 | "libcuttlefish_fs", |
| 159 | ], |
| 160 | defaults: ["cuttlefish_host"], |
| 161 | } |
| 162 | |
| 163 | cc_test_host { |
| 164 | name: "vsoc_graphics_test", |
| 165 | srcs: [ |
| 166 | "common/vsoc/lib/graphics_test.cpp", |
| 167 | ], |
| 168 | static_libs: [ |
| 169 | "vsoc_lib", |
| 170 | "libbase", |
| 171 | ], |
| 172 | defaults: ["cuttlefish_host"], |
| 173 | } |
| 174 | |
| 175 | cc_binary_host { |
| 176 | name: "host_region_e2e_test", |
| 177 | srcs: [ |
| 178 | "host/vsoc/lib/host_region_e2e_test.cpp", |
| 179 | ], |
| 180 | static_libs: [ |
| 181 | "vsoc_lib", |
| 182 | "libgtest_host", |
| 183 | "libbase", |
| 184 | "cuttlefish_auto_resources", |
| 185 | "libcuttlefish_fs", |
Tomasz Wiszkowski | c2c4dd6 | 2017-11-30 10:19:22 -0800 | [diff] [blame] | 186 | "libgflags", |
Greg Hartman | a4ff248 | 2017-10-03 16:35:00 -0700 | [diff] [blame] | 187 | ], |
| 188 | defaults: ["cuttlefish_host"], |
Greg Hartman | bff7e63 | 2017-09-29 11:32:08 -0700 | [diff] [blame] | 189 | } |