From 0ebd54cf38a24b7df07c75f904d647c8dc17bbeb Mon Sep 17 00:00:00 2001 From: Brian Ho Date: Tue, 13 Aug 2019 22:45:14 +0000 Subject: [PATCH] Update BUILD flags to support Chrome OS This CL updates a few flags to support Chrome OS: - Disables the OpenGL backend on Chrome OS builds. - Removes the X11 dependency for Chrome OS builds because we do not support X11. - Removes the XCB dependency (again, no X11). BUG=chromium:993457 TEST=e2e and unit tests build and pass on Intel Chrome OS devices Change-Id: I1cb06453ccc94d1b68a6998ea635bddd6fb7b5ad Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10100 Commit-Queue: Kai Ninomiya Reviewed-by: Austin Eng Reviewed-by: Kai Ninomiya --- scripts/dawn_features.gni | 2 +- src/common/BUILD.gn | 4 ++++ src/common/vulkan_platform.h | 2 +- third_party/BUILD.gn | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni index d86f2189cb..a74942b650 100644 --- a/scripts/dawn_features.gni +++ b/scripts/dawn_features.gni @@ -33,7 +33,7 @@ declare_args() { # Enables the compilation of Dawn's OpenGL backend # (best effort, non-conformant) - dawn_enable_opengl = is_linux + dawn_enable_opengl = is_linux && !is_chromeos # Enables the compilation of Dawn's Vulkan backend dawn_enable_vulkan = is_linux || is_win diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn index 0d05c275b3..9093e8240a 100644 --- a/src/common/BUILD.gn +++ b/src/common/BUILD.gn @@ -60,6 +60,10 @@ config("dawn_internal") { defines += [ "DAWN_ENABLE_BACKEND_VULKAN" ] } + if (is_linux && !is_chromeos) { + defines += [ "DAWN_USE_X11" ] + } + # Only internal Dawn targets can use this config, this means only targets in # this BUILD.gn file. visibility = [ ":*" ] diff --git a/src/common/vulkan_platform.h b/src/common/vulkan_platform.h index e6b2dfbbf6..03176628d0 100644 --- a/src/common/vulkan_platform.h +++ b/src/common/vulkan_platform.h @@ -157,7 +157,7 @@ class alignas(kNativeVkHandleAlignment) VkNonDispatchableHandle { # include "common/windows_with_undefs.h" #endif // Remove X11/Xlib.h macros after vulkan_platform's include of it. -#if defined(DAWN_PLATFORM_LINUX) +#if defined(DAWN_USE_X11) # include "common/xlib_with_undefs.h" #endif diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index 01a28a6f2a..c880cb9985 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn @@ -122,7 +122,7 @@ config("vulkan_headers_config") { if (is_win) { defines = [ "VK_USE_PLATFORM_WIN32_KHR" ] } - if (is_linux) { + if (is_linux && !is_chromeos) { defines = [ "VK_USE_PLATFORM_XCB_KHR" ] } if (is_android) {