forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-02-17 557c24d082b6ecb9bfe5407b77ae43fa7650a5dc
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
Upstream-Status: Pending
 
Signed-off-by: Maksim Sisov <msisov@igalia.com>
---
From 77393e5d862f52bfc1ead8f855dde79d6b412bec Mon Sep 17 00:00:00 2001
From: Maksim Sisov <msisov@igalia.com>
Date: Tue, 28 Sep 2021 09:12:30 +0300
Subject: [PATCH] ozone/wayland: don't build xcb for pure wayland builds.
 
Swiftshader assumes is_linux == x11, but it's no longer true
after Ozone became default on Linux.
---
 third_party/swiftshader/src/Vulkan/BUILD.gn | 3 ++-
 third_party/swiftshader/src/WSI/BUILD.gn    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
 
diff --git a/third_party/swiftshader/src/Vulkan/BUILD.gn b/third_party/swiftshader/src/Vulkan/BUILD.gn
index 1612e1a33..bfad5f6c3 100644
--- a/third_party/swiftshader/src/Vulkan/BUILD.gn
+++ b/third_party/swiftshader/src/Vulkan/BUILD.gn
@@ -13,12 +13,13 @@
 # limitations under the License.
 
 import("//build_overrides/build.gni")
+import("//build/config/ozone.gni")
 import("../swiftshader.gni")
 import("vulkan.gni")
 
 # Need a separate config to ensure the warnings are added to the end.
 config("swiftshader_libvulkan_private_config") {
-  if (is_linux || is_chromeos) {
+  if ((is_linux || is_chromeos) && ozone_platform_x11) {
     defines = [
       "VK_USE_PLATFORM_XLIB_KHR",
       "VK_USE_PLATFORM_XCB_KHR",
diff --git a/third_party/swiftshader/src/WSI/BUILD.gn b/third_party/swiftshader/src/WSI/BUILD.gn
index 248ba315b..995d52479 100644
--- a/third_party/swiftshader/src/WSI/BUILD.gn
+++ b/third_party/swiftshader/src/WSI/BUILD.gn
@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import("//build/config/ozone.gni")
 import("../swiftshader.gni")
 
 config("WSI_metal_weak_framework") {
@@ -33,7 +34,7 @@ swiftshader_source_set("WSI") {
     "VkSwapchainKHR.hpp",
   ]
 
-  if (is_linux || is_chromeos) {
+  if ((is_linux || is_chromeos) && ozone_platform_x11) {
     sources += [
       "XcbSurfaceKHR.cpp",
       "XcbSurfaceKHR.hpp",
-- 
2.25.1