blob: 945ce41ea082416a8ccbaa41a178af1114daee1e [file] [log] [blame]
Greg Hartmanbff7e632017-09-29 11:32:08 -07001//
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
16subdirs = [
17 "common",
Tomasz Wiszkowskieb642fc2017-11-28 12:36:31 -080018 "guest",
Greg Hartmana4ff2482017-10-03 16:35:00 -070019 "host",
Greg Hartmanbff7e632017-09-29 11:32:08 -070020]
21
22cc_library_headers {
Greg Hartmana4ff2482017-10-03 16:35:00 -070023 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
29cc_library_headers {
30 name: "cuttlefish_glog",
31 export_include_dirs: ["common/libs"],
32 host_supported: true,
Greg Hartmanbff7e632017-09-29 11:32:08 -070033}
34
35cc_defaults {
Greg Hartmance872ef2017-12-04 22:51:47 -080036 name: "cuttlefish_base",
Tomasz Wiszkowski55d53ff2017-12-04 15:39:57 -080037 gnu_extensions: false,
38 header_libs: [
39 "cuttlefish_common_headers",
40 "cuttlefish_kernel_headers",
41 ],
Tomasz Wiszkowski55d53ff2017-12-04 15:39:57 -080042 target: {
43 linux: {
44 host_ldlibs: ["-lrt"],
45 cflags: ["-DCUTTLEFISH_HOST"],
46 },
Greg Hartmance872ef2017-12-04 22:51:47 -080047 // We don't need 32 bit host-side builds
48 // TODO(ghartman): linux_glibc on master
49 linux_x86: {
Tomasz Wiszkowski55d53ff2017-12-04 15:39:57 -080050 enabled: false,
51 },
Greg Hartmance872ef2017-12-04 22:51:47 -080052 // We don't need Darwin host-side builds
Greg Hartmana4ff2482017-10-03 16:35:00 -070053 darwin: {
54 enabled: false,
55 },
Greg Hartmanbff7e632017-09-29 11:32:08 -070056 },
Greg Hartmance872ef2017-12-04 22:51:47 -080057 vendor: true,
Greg Hartmana4ff2482017-10-03 16:35:00 -070058}
59
Greg Hartmance872ef2017-12-04 22:51:47 -080060// ARM code should not touch the VSoC window on an x86 CPU.
Greg Hartman98d18af2017-12-05 13:12:31 -080061cc_defaults {
Greg Hartman6da43022017-12-05 11:16:02 -080062 name: "cuttlefish_native_isa",
Greg Hartmance872ef2017-12-04 22:51:47 -080063 target: {
Greg Hartman98d18af2017-12-05 13:12:31 -080064 android_arm: {
65 enabled: false,
66 },
67 },
68}
69
Greg Hartmance872ef2017-12-04 22:51:47 -080070cc_defaults {
71 name: "cuttlefish_host_only",
72 device_supported: false,
73 host_supported: true,
74 defaults: ["cuttlefish_base"],
75}
76
77cc_defaults {
78 name: "cuttlefish_host_and_guest",
79 host_supported: true,
80 defaults: ["cuttlefish_base"],
81}
82
83cc_library_shared {
Greg Hartmana4ff2482017-10-03 16:35:00 -070084 name: "vsoc_lib",
85 srcs: [
86 "common/vsoc/lib/compat.cpp",
87 "common/vsoc/lib/e2e_test_region_layout.cpp",
88 "common/vsoc/lib/fb_bcast_layout.cpp",
89 "common/vsoc/lib/gralloc_layout.cpp",
90 "common/vsoc/lib/lock_common.cpp",
91 "common/vsoc/lib/region_view.cpp",
Tomasz Wiszkowskic2c4dd62017-11-30 10:19:22 -080092 "common/vsoc/lib/wifi_exchange_layout.cpp",
Tomasz Wiszkowski719ce862017-12-01 12:31:17 -080093 "common/vsoc/lib/wifi_exchange_view.cpp",
Greg Hartmana4ff2482017-10-03 16:35:00 -070094 ],
Greg Hartmance872ef2017-12-04 22:51:47 -080095 header_libs: ["cuttlefish_glog"],
96 shared_libs: [
Greg Hartmana4ff2482017-10-03 16:35:00 -070097 "libcuttlefish_fs",
Greg Hartman98d18af2017-12-05 13:12:31 -080098 "cuttlefish_auto_resources",
Greg Hartmana4ff2482017-10-03 16:35:00 -070099 "libbase",
100 ],
Tomasz Wiszkowski55d53ff2017-12-04 15:39:57 -0800101 target: {
Greg Hartmance872ef2017-12-04 22:51:47 -0800102 //TODO(ghartman): linux_glibc on master
Tomasz Wiszkowski55d53ff2017-12-04 15:39:57 -0800103 linux: {
Tomasz Wiszkowski55d53ff2017-12-04 15:39:57 -0800104 srcs: [
105 "host/vsoc/lib/host_lock.cpp",
106 "host/vsoc/lib/region_control.cpp",
107 "host/vsoc/lib/region_view.cpp",
108 ],
109 },
110 android: {
111 srcs: [
112 "guest/vsoc/lib/guest_lock.cpp",
113 "guest/vsoc/lib/region_control.cpp",
114 "guest/vsoc/lib/region_view.cpp",
115 ],
116 },
117 },
Greg Hartmance872ef2017-12-04 22:51:47 -0800118 defaults: ["cuttlefish_host_and_guest", "cuttlefish_native_isa"],
Greg Hartmana4ff2482017-10-03 16:35:00 -0700119}
120
121cc_library_host_static {
122 name: "libvsoc_gralloc",
123 srcs: [
124 "host/vsoc/gralloc/gralloc_buffer_region.cpp",
125 ],
126 header_libs: ["cuttlefish_glog"],
Greg Hartmance872ef2017-12-04 22:51:47 -0800127 shared_libs: [
Greg Hartmana4ff2482017-10-03 16:35:00 -0700128 "vsoc_lib",
129 "libbase",
130 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800131 defaults: ["cuttlefish_host_only"],
Greg Hartmana4ff2482017-10-03 16:35:00 -0700132}
133
134cc_test_host {
135 name: "circqueue_test",
136 srcs: [
137 "common/vsoc/lib/circqueue_test.cpp",
138 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800139 shared_libs: [
Greg Hartmana4ff2482017-10-03 16:35:00 -0700140 "vsoc_lib",
141 "libbase",
142 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800143 defaults: ["cuttlefish_host_only"],
Greg Hartmana4ff2482017-10-03 16:35:00 -0700144}
145
146cc_test_host {
147 name: "lock_test",
148 srcs: [
149 "common/vsoc/lib/lock_test.cpp",
150 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800151 shared_libs: [
Greg Hartmana4ff2482017-10-03 16:35:00 -0700152 "vsoc_lib",
Greg Hartmana4ff2482017-10-03 16:35:00 -0700153 "libcuttlefish_fs",
Greg Hartmance872ef2017-12-04 22:51:47 -0800154 "cuttlefish_auto_resources",
155 "libbase",
Greg Hartmana4ff2482017-10-03 16:35:00 -0700156 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800157 static_libs: [
158 "libgtest_host",
159 ],
160 defaults: ["cuttlefish_host_only"],
Greg Hartmana4ff2482017-10-03 16:35:00 -0700161}
162
163cc_test_host {
164 name: "vsoc_graphics_test",
165 srcs: [
166 "common/vsoc/lib/graphics_test.cpp",
167 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800168 shared_libs: [
Greg Hartmana4ff2482017-10-03 16:35:00 -0700169 "vsoc_lib",
170 "libbase",
171 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800172 defaults: ["cuttlefish_host_only"],
Greg Hartmana4ff2482017-10-03 16:35:00 -0700173}
174
175cc_binary_host {
176 name: "host_region_e2e_test",
177 srcs: [
178 "host/vsoc/lib/host_region_e2e_test.cpp",
179 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800180 shared_libs: [
Greg Hartmana4ff2482017-10-03 16:35:00 -0700181 "vsoc_lib",
Greg Hartmana4ff2482017-10-03 16:35:00 -0700182 "libcuttlefish_fs",
Greg Hartmance872ef2017-12-04 22:51:47 -0800183 "cuttlefish_auto_resources",
184 "libbase",
185 ],
186 static_libs: [
Greg Hartman6da43022017-12-05 11:16:02 -0800187 "libcuttlefish_host_config",
Greg Hartmance872ef2017-12-04 22:51:47 -0800188 "libgtest_host",
Tomasz Wiszkowskic2c4dd62017-11-30 10:19:22 -0800189 "libgflags",
Greg Hartmana4ff2482017-10-03 16:35:00 -0700190 ],
Greg Hartmance872ef2017-12-04 22:51:47 -0800191 defaults: ["cuttlefish_host_only"],
Greg Hartmanbff7e632017-09-29 11:32:08 -0700192}