Bob Badour | 650a8da | 2021-02-12 21:06:44 -0800 | [diff] [blame] | 1 | // *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE |
| 2 | // CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE |
| 3 | // DEPENDING ON IT IN YOUR PROJECT. *** |
Jason Macnak | 842f476 | 2023-04-28 11:55:05 -0700 | [diff] [blame] | 4 | package { |
| 5 | default_applicable_licenses: ["hardware_google_gfxstream_license"], |
| 6 | } |
| 7 | |
Bob Badour | 650a8da | 2021-02-12 21:06:44 -0800 | [diff] [blame] | 8 | // Added automatically by a large-scale-change that took the approach of |
| 9 | // 'apply every license found to every target'. While this makes sure we respect |
| 10 | // every license restriction, it may not be entirely correct. |
| 11 | // |
| 12 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 13 | // |
| 14 | // Please consider splitting the single license below into multiple licenses, |
| 15 | // taking care not to lose any license_kind information, and overriding the |
| 16 | // default license using the 'licenses: [...]' property on targets as needed. |
| 17 | // |
| 18 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 19 | // to attach the license to, and including a comment whether the files may be |
| 20 | // used in the current project. |
| 21 | // See: http://go/android-license-faq |
Jason Macnak | 842f476 | 2023-04-28 11:55:05 -0700 | [diff] [blame] | 22 | license { |
| 23 | name: "hardware_google_gfxstream_license", |
Joshua Duong | 9a82ffb | 2022-09-14 09:32:35 -0700 | [diff] [blame] | 24 | visibility: [ |
| 25 | "//hardware/google/aemu:__subpackages__", |
| 26 | ":__subpackages__", |
| 27 | ], |
Jason Macnak | 842f476 | 2023-04-28 11:55:05 -0700 | [diff] [blame] | 28 | license_kinds: [ |
| 29 | "SPDX-license-identifier-Apache-2.0", |
Bob Badour | 650a8da | 2021-02-12 21:06:44 -0800 | [diff] [blame] | 30 | "SPDX-license-identifier-BSD", |
Kaiyi Li | 6db9640 | 2022-02-09 10:52:09 -0800 | [diff] [blame] | 31 | "SPDX-license-identifier-CC-BY-4.0", |
Bob Badour | 650a8da | 2021-02-12 21:06:44 -0800 | [diff] [blame] | 32 | "SPDX-license-identifier-ISC", |
Jason Macnak | 842f476 | 2023-04-28 11:55:05 -0700 | [diff] [blame] | 33 | "SPDX-license-identifier-MIT", |
Gurchetan Singh | 876877a | 2023-08-07 15:15:58 -0700 | [diff] [blame] | 34 | "SPDX-license-identifier-BSL-1.0", |
Bob Badour | 650a8da | 2021-02-12 21:06:44 -0800 | [diff] [blame] | 35 | "legacy_unencumbered", |
| 36 | ], |
Bob Badour | 650a8da | 2021-02-12 21:06:44 -0800 | [diff] [blame] | 37 | } |
| 38 | |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 39 | cc_library_headers { |
| 40 | name: "gfxstream_headers", |
Jason Macnak | 843b84b | 2023-05-19 14:19:25 -0700 | [diff] [blame] | 41 | vendor_available: true, |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 42 | host_supported: true, |
| 43 | export_include_dirs: [ |
| 44 | ".", |
| 45 | "include", |
Jason Macnak | 648a9ed | 2023-05-19 10:31:36 -0700 | [diff] [blame] | 46 | "host", |
| 47 | "host/gl", |
| 48 | "host/gl/glestranslator/include", |
| 49 | "host/vulkan", |
Joshua Duong | 88a0f0a | 2022-10-25 11:32:14 -0700 | [diff] [blame] | 50 | "utils/include", |
Jiyong Park | 8d7916e | 2020-12-07 15:07:35 +0900 | [diff] [blame] | 51 | ], |
Joshua Duong | 9d3511c | 2022-09-06 11:10:45 -0700 | [diff] [blame] | 52 | header_libs: [ |
| 53 | "aemu_common_headers", |
Matt Sandy | e815f35 | 2023-03-10 18:28:35 +0000 | [diff] [blame] | 54 | "gfxstream_magma_headers", |
Jason Macnak | b808eeb | 2024-02-27 10:03:39 -0800 | [diff] [blame] | 55 | "libgfxstream_vulkan_headers", |
Joshua Duong | 9d3511c | 2022-09-06 11:10:45 -0700 | [diff] [blame] | 56 | ], |
| 57 | export_header_lib_headers: [ |
| 58 | "aemu_common_headers", |
Matt Sandy | e815f35 | 2023-03-10 18:28:35 +0000 | [diff] [blame] | 59 | "gfxstream_magma_headers", |
Jason Macnak | b808eeb | 2024-02-27 10:03:39 -0800 | [diff] [blame] | 60 | "libgfxstream_vulkan_headers", |
Joshua Duong | 9d3511c | 2022-09-06 11:10:45 -0700 | [diff] [blame] | 61 | ], |
Jiyong Park | 8d7916e | 2020-12-07 15:07:35 +0900 | [diff] [blame] | 62 | apex_available: [ |
| 63 | "//apex_available:platform", |
| 64 | "com.android.virt", |
| 65 | ], |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 66 | } |
| 67 | |
Lingfeng Yang | eb75267 | 2020-11-09 16:35:58 -0800 | [diff] [blame] | 68 | cc_library_headers { |
| 69 | name: "gfxstream_x11_headers", |
Jason Macnak | 843b84b | 2023-05-19 14:19:25 -0700 | [diff] [blame] | 70 | vendor_available: true, |
Lingfeng Yang | eb75267 | 2020-11-09 16:35:58 -0800 | [diff] [blame] | 71 | host_supported: true, |
| 72 | export_include_dirs: [ |
Jason Macnak | 648a9ed | 2023-05-19 10:31:36 -0700 | [diff] [blame] | 73 | "host/apigen-codec-common", |
Jiyong Park | 8d7916e | 2020-12-07 15:07:35 +0900 | [diff] [blame] | 74 | ], |
| 75 | apex_available: [ |
| 76 | "//apex_available:platform", |
| 77 | "com.android.virt", |
| 78 | ], |
Lingfeng Yang | eb75267 | 2020-11-09 16:35:58 -0800 | [diff] [blame] | 79 | } |
| 80 | |
Matt Sandy | e815f35 | 2023-03-10 18:28:35 +0000 | [diff] [blame] | 81 | cc_library_headers { |
| 82 | name: "gfxstream_magma_headers", |
Jason Macnak | 843b84b | 2023-05-19 14:19:25 -0700 | [diff] [blame] | 83 | vendor_available: true, |
Matt Sandy | e815f35 | 2023-03-10 18:28:35 +0000 | [diff] [blame] | 84 | host_supported: true, |
| 85 | export_include_dirs: [ |
| 86 | "third-party/fuchsia/magma/include", |
Matt Sandy | df03981 | 2023-04-24 10:59:21 -0700 | [diff] [blame] | 87 | // TODO(b/274956288): use consistent header paths |
| 88 | "third-party/fuchsia/magma/include/lib", |
Matt Sandy | e815f35 | 2023-03-10 18:28:35 +0000 | [diff] [blame] | 89 | ], |
| 90 | apex_available: [ |
| 91 | "//apex_available:platform", |
| 92 | "com.android.virt", |
| 93 | ], |
| 94 | } |
| 95 | |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 96 | cc_defaults { |
Jason Macnak | 843b84b | 2023-05-19 14:19:25 -0700 | [diff] [blame] | 97 | name: "gfxstream_cc_defaults", |
| 98 | cflags: [ |
| 99 | "-DGFXSTREAM", |
| 100 | ], |
| 101 | } |
| 102 | |
Marcin Radomski | d578033 | 2024-07-16 14:04:39 +0000 | [diff] [blame] | 103 | soong_config_string_variable { |
| 104 | name: "mesa3d_platforms", |
| 105 | values: [ |
| 106 | // Android surfaceless build |
| 107 | "none", |
| 108 | // The default when variable is not set is Android |
| 109 | ], |
| 110 | } |
| 111 | |
Jason Macnak | 843b84b | 2023-05-19 14:19:25 -0700 | [diff] [blame] | 112 | cc_defaults { |
| 113 | name: "gfxstream_guest_cc_defaults", |
| 114 | defaults: [ |
| 115 | "gfxstream_cc_defaults", |
| 116 | ], |
Marcin Radomski | d06a9fe | 2024-08-14 16:55:28 +0000 | [diff] [blame] | 117 | cflags: select(soong_config_variable("gfxstream", "mesa3d_platforms"), { |
| 118 | // Android surfaceless build |
| 119 | "none": [ |
| 120 | "-UANDROID", |
| 121 | "-U__ANDROID__", |
| 122 | "-DLINUX_GUEST_BUILD", |
| 123 | ], |
| 124 | // The default when variable is not set is Android |
| 125 | default: [ |
| 126 | "-DVK_USE_PLATFORM_ANDROID_KHR", |
| 127 | ], |
| 128 | }), |
Jason Macnak | 843b84b | 2023-05-19 14:19:25 -0700 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | cc_defaults { |
| 132 | name: "gfxstream_host_cc_defaults", |
| 133 | defaults: [ |
| 134 | "gfxstream_cc_defaults", |
| 135 | ], |
Jason Macnak | 9bc12d9 | 2024-08-28 19:20:05 +0000 | [diff] [blame] | 136 | cflags: [ |
| 137 | "-DGFXSTREAM_BUILD_WITH_TRACING=1", |
| 138 | ] + select(soong_config_variable("gfxstream", "mesa3d_platforms"), { |
Marcin Radomski | a36f75a | 2024-08-21 17:16:10 +0000 | [diff] [blame] | 139 | // Android surfaceless build |
| 140 | "none": [ |
| 141 | "-DGFXSTREAM_ENABLE_GUEST_VIRTIO_RESOURCE_TILING_CONTROL=1", |
| 142 | ], |
| 143 | // The default when variable is not set is Android |
| 144 | default: [], |
| 145 | }), |
Jason Macnak | 843b84b | 2023-05-19 14:19:25 -0700 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | cc_defaults { |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 149 | name: "gfxstream_defaults", |
Joshua Duong | e3b2c5c | 2022-05-31 08:27:47 -0700 | [diff] [blame] | 150 | cflags: [ |
| 151 | // Android build system has some global cflags that we cannot override (e.g. |
| 152 | // -Werror=return-type), so -Wno-return-type and -Wno-return-type-c-linkage will not work. |
| 153 | // See build/soong/cc/config/global.go |
| 154 | "-DUSING_ANDROID_BP", |
| 155 | "-D_FILE_OFFSET_BITS=64", |
Gurchetan Singh | 2cf08ad | 2023-11-07 19:45:32 -0800 | [diff] [blame] | 156 | "-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT", |
Gurchetan Singh | 95b30dc | 2024-01-18 18:31:15 -0800 | [diff] [blame] | 157 | "-DGFXSTREAM_ENABLE_HOST_GLES=1", |
Gurchetan Singh | 29946e8 | 2024-02-08 08:51:09 -0800 | [diff] [blame] | 158 | "-DGFXSTREAM_ENABLE_HOST_VK_SNAPSHOT=1", |
Joshua Duong | e3b2c5c | 2022-05-31 08:27:47 -0700 | [diff] [blame] | 159 | "-Wno-unreachable-code-loop-increment", |
| 160 | "-Wno-unused-parameter", |
| 161 | "-Wno-unused-function", |
| 162 | "-Wno-unused-variable", |
| 163 | "-Wno-ignored-qualifiers", |
| 164 | "-Wno-reorder-ctor", |
| 165 | "-Wno-mismatched-tags", |
| 166 | "-Wno-missing-field-initializers", |
| 167 | "-Wno-implicit-fallthrough", |
| 168 | "-Wno-unused-private-field", |
| 169 | "-Wno-macro-redefined", |
| 170 | ], |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 171 | header_libs: [ |
| 172 | "gfxstream_headers", |
Lingfeng Yang | eb75267 | 2020-11-09 16:35:58 -0800 | [diff] [blame] | 173 | "gfxstream_x11_headers", |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 174 | ], |
| 175 | target: { |
| 176 | host: { |
| 177 | compile_multilib: "64", |
Lingfeng Yang | e2c5bb2 | 2020-11-11 13:44:39 -0800 | [diff] [blame] | 178 | cflags: [ |
| 179 | "-U__ANDROID__", |
| 180 | "-UANDROID", |
Jason Macnak | e17ba9b | 2024-02-27 10:19:24 -0800 | [diff] [blame] | 181 | ], |
Lingfeng Yang | e2c5bb2 | 2020-11-11 13:44:39 -0800 | [diff] [blame] | 182 | }, |
| 183 | android: { |
| 184 | compile_multilib: "64", |
Jason Macnak | e17ba9b | 2024-02-27 10:19:24 -0800 | [diff] [blame] | 185 | shared_libs: ["libnativewindow"], |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 186 | }, |
Lingfeng Yang | eb75267 | 2020-11-09 16:35:58 -0800 | [diff] [blame] | 187 | linux_bionic_arm64: { |
| 188 | enabled: true, |
Jason Macnak | e17ba9b | 2024-02-27 10:19:24 -0800 | [diff] [blame] | 189 | cflags: ["-Dandroidbionic"], |
| 190 | }, |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 191 | }, |
Lingfeng Yang | a2a3b0f | 2020-11-04 11:50:46 -0800 | [diff] [blame] | 192 | host_supported: true, |
Jason Macnak | 459dd87 | 2023-09-13 08:27:41 -0700 | [diff] [blame] | 193 | vendor_available: true, |
Jiyong Park | 8d7916e | 2020-12-07 15:07:35 +0900 | [diff] [blame] | 194 | |
| 195 | apex_available: [ |
| 196 | "//apex_available:platform", |
| 197 | "com.android.virt", |
Jason Macnak | 842f476 | 2023-04-28 11:55:05 -0700 | [diff] [blame] | 198 | ], |
| 199 | } |