forked from google/gfxstream
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAndroid.bp
More file actions
187 lines (179 loc) · 4.92 KB
/
Android.bp
File metadata and controls
187 lines (179 loc) · 4.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// Copyright 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expresso or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: ["hardware_google_gfxstream_license"],
}
license {
name: "hardware_google_gfxstream_license",
visibility: [
"//hardware/google/aemu:__subpackages__",
":__subpackages__",
],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-BSD",
"SPDX-license-identifier-ISC", // X11 headers
"SPDX-license-identifier-MIT",
"legacy_unencumbered",
],
}
cc_library_headers {
name: "gfxstream_headers",
vendor_available: true,
host_supported: true,
export_include_dirs: [
".",
"host",
"host/gl",
"host/vulkan",
"host/include",
],
header_libs: [
"gfxstream_magma_headers",
"libgfxstream_thirdparty_vulkan_headers",
],
export_header_lib_headers: [
"gfxstream_magma_headers",
"libgfxstream_thirdparty_vulkan_headers",
],
apex_available: [
"//apex_available:platform",
"com.android.virt",
],
}
cc_library_headers {
name: "gfxstream_magma_headers",
vendor_available: true,
host_supported: true,
export_include_dirs: [
"third_party/fuchsia/magma/include",
// TODO(b/274956288): use consistent header paths
"third_party/fuchsia/magma/include/lib",
],
apex_available: [
"//apex_available:platform",
"com.android.virt",
],
}
soong_config_string_variable {
name: "mesa3d_platforms",
values: [
// Android surfaceless build
"none",
// The default when variable is not set is Android
],
}
cc_defaults {
name: "gfxstream_defaults",
cflags: [
// Android build system has some global cflags that we cannot override (e.g.
// -Werror=return-type), so -Wno-return-type and -Wno-return-type-c-linkage will not work.
// See build/soong/cc/config/global.go
"-DGFXSTREAM",
"-DUSING_ANDROID_BP",
"-D_FILE_OFFSET_BITS=64",
"-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT",
"-DGFXSTREAM_ENABLE_GUEST_GOLDFISH=1",
"-DGFXSTREAM_ENABLE_HOST_GLES=1",
"-Wall",
"-Werror",
"-Wextra",
"-Wformat",
"-Wshadow",
"-Wthread-safety",
"-Wno-unused-function",
"-Wno-unused-parameter",
"-Wno-unused-private-field",
"-Wno-unused-variable",
],
header_libs: [
"gfxstream_headers",
],
target: {
android: {
shared_libs: [
"liblog",
"libnativewindow",
],
},
host: {
compile_multilib: "64",
},
linux_bionic_arm64: {
enabled: true,
cflags: ["-Dandroidbionic"],
},
},
product_variables: {
platform_sdk_version: {
cflags: ["-DANDROID_API_LEVEL=%d"],
},
},
vendor_available: true,
host_supported: true,
apex_available: [
"//apex_available:platform",
"com.android.virt",
],
}
cc_defaults {
name: "gfxstream_guest_cc_defaults",
defaults: [
"gfxstream_defaults",
],
cflags: select(soong_config_variable("gfxstream", "mesa3d_platforms"), {
// Android surfaceless build
"none": [
"-UANDROID",
"-U__ANDROID__",
"-DLINUX_GUEST_BUILD",
],
// The default when variable is not set is Android
default: [
"-DVK_USE_PLATFORM_ANDROID_KHR",
],
}),
vendor_available: false,
vendor: true,
}
cc_defaults {
name: "gfxstream_host_cc_defaults",
defaults: [
"gfxstream_defaults",
],
cflags: [
"-DGFXSTREAM_BUILD_WITH_SNAPSHOT_SUPPORT=1",
"-DGFXSTREAM_BUILD_WITH_TRACING=1",
] + select(soong_config_variable("gfxstream", "mesa3d_platforms"), {
// Android surfaceless build
"none": [
"-DGFXSTREAM_ENABLE_GUEST_VIRTIO_RESOURCE_TILING_CONTROL=1",
],
// The default when variable is not set is Android
default: [],
}),
target: {
android: {
cflags: [
"-DVK_USE_PLATFORM_ANDROID_KHR",
],
compile_multilib: "64",
},
host: {
cflags: [
"-DGFXSTREAM_BUILD_WITH_SNAPSHOT_FRONTEND_SUPPORT=1",
],
},
},
}