Commit d22b8be4 by Ethan Lee Committed by Commit Bot

GN: Make X11 optional, based on a user-defined variable.

Not all Linux platforms will have X11 available (Wayland, GGP), so we have to declare a variable that checks use_x11 separately. Bug: angleproject:4116 Change-Id: I7e33956da6344b8db4d4e32dbbd1b42f58f7019c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1919632Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 53e45360
...@@ -60,3 +60,4 @@ Till Rathmann ...@@ -60,3 +60,4 @@ Till Rathmann
Nick Shaforostov Nick Shaforostov
Jaime Bernardo Jaime Bernardo
Le Hoang Quyen Le Hoang Quyen
Ethan Lee
...@@ -20,7 +20,7 @@ if (angle_has_build) { ...@@ -20,7 +20,7 @@ if (angle_has_build) {
declare_args() { declare_args() {
# Use the PCI lib to collect GPU information on Linux. # Use the PCI lib to collect GPU information on Linux.
use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) && use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) &&
(use_x11 || use_ozone) (angle_use_x11 || use_ozone)
# Link in system libGL, to work with apitrace. See doc/DebuggingTips.md. # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md.
angle_link_glx = false angle_link_glx = false
...@@ -380,7 +380,7 @@ angle_static_library("angle_gpu_info_util") { ...@@ -380,7 +380,7 @@ angle_static_library("angle_gpu_info_util") {
if (is_linux || is_fuchsia) { if (is_linux || is_fuchsia) {
sources += libangle_gpu_info_util_linux_sources sources += libangle_gpu_info_util_linux_sources
if (use_x11) { if (angle_use_x11) {
sources += libangle_gpu_info_util_x11_sources sources += libangle_gpu_info_util_x11_sources
deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
defines += [ "GPU_INFO_USE_X11" ] defines += [ "GPU_INFO_USE_X11" ]
...@@ -582,7 +582,7 @@ config("libANGLE_config") { ...@@ -582,7 +582,7 @@ config("libANGLE_config") {
} }
} }
if (use_x11) { if (angle_use_x11) {
defines += [ "ANGLE_USE_X11" ] defines += [ "ANGLE_USE_X11" ]
} }
} }
...@@ -689,7 +689,7 @@ angle_source_set("libANGLE_base") { ...@@ -689,7 +689,7 @@ angle_source_set("libANGLE_base") {
if (is_win) { if (is_win) {
sources += libangle_gl_wgl_sources sources += libangle_gl_wgl_sources
} }
if (use_x11) { if (angle_use_x11) {
sources += libangle_gl_glx_sources sources += libangle_gl_glx_sources
deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
libs += [ libs += [
...@@ -1062,7 +1062,7 @@ angle_source_set("angle_util_loader") { ...@@ -1062,7 +1062,7 @@ angle_source_set("angle_util_loader") {
config("angle_util_config") { config("angle_util_config") {
include_dirs = [ "." ] include_dirs = [ "." ]
if (is_linux && use_x11) { if (is_linux && angle_use_x11) {
libs = [ "X11" ] libs = [ "X11" ]
} }
} }
...@@ -1112,7 +1112,7 @@ foreach(is_shared_library, ...@@ -1112,7 +1112,7 @@ foreach(is_shared_library,
] ]
} }
if (use_x11) { if (angle_use_x11) {
sources += util_x11_sources sources += util_x11_sources
} }
......
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//gni/angle.gni")
vulkan_use_x11 = angle_use_x11
...@@ -21,6 +21,8 @@ if (angle_has_build) { ...@@ -21,6 +21,8 @@ if (angle_has_build) {
if (is_win) { if (is_win) {
import("//build/config/win/visual_studio_version.gni") import("//build/config/win/visual_studio_version.gni")
} }
angle_use_x11 = use_x11 && !is_ggp
} else { } else {
declare_args() { declare_args() {
is_ubsan = false is_ubsan = false
...@@ -28,7 +30,7 @@ if (angle_has_build) { ...@@ -28,7 +30,7 @@ if (angle_has_build) {
is_asan = false is_asan = false
build_with_chromium = false build_with_chromium = false
dcheck_always_on = false dcheck_always_on = false
use_x11 = is_linux angle_use_x11 = is_linux && !is_ggp
use_ozone = false use_ozone = false
use_fuzzing_engine = false use_fuzzing_engine = false
} }
...@@ -84,16 +86,17 @@ declare_args() { ...@@ -84,16 +86,17 @@ declare_args() {
angle_enable_d3d9 = is_win && !angle_is_winuwp angle_enable_d3d9 = is_win && !angle_is_winuwp
angle_enable_d3d11 = is_win angle_enable_d3d11 = is_win
angle_enable_gl = angle_enable_gl =
(ozone_platform_gbm || !is_linux || (use_x11 && !is_chromeos)) && (ozone_platform_gbm || !is_linux || (angle_use_x11 && !is_chromeos)) &&
!is_fuchsia && !angle_is_winuwp !is_fuchsia && !angle_is_winuwp && !is_ggp
# ANGLE Vulkan backend on Android requires API level 26, i.e. Oreo, due to # ANGLE Vulkan backend on Android requires API level 26, i.e. Oreo, due to
# Vulkan Validation Layers compatibility issues, see http://crrev/c/1405714. # Vulkan Validation Layers compatibility issues, see http://crrev/c/1405714.
# Otherwise, API level 24 would have been enough. # Otherwise, API level 24 would have been enough.
angle_enable_vulkan = angle_enable_vulkan =
angle_has_build && angle_has_build &&
((is_win && !angle_is_winuwp) || (is_linux && use_x11 && !is_chromeos) || ((is_win && !angle_is_winuwp) ||
(is_android && ndk_api_level_at_least_26) || is_fuchsia) (is_linux && angle_use_x11 && !is_chromeos) ||
(is_android && ndk_api_level_at_least_26) || is_fuchsia || is_ggp)
angle_enable_null = true angle_enable_null = true
angle_enable_essl = true angle_enable_essl = true
angle_enable_glsl = true angle_enable_glsl = true
......
...@@ -19,7 +19,7 @@ declare_args() { ...@@ -19,7 +19,7 @@ declare_args() {
# Currently SwiftShader's Vulkan front-end doesn't build on Android. # Currently SwiftShader's Vulkan front-end doesn't build on Android.
# SwiftShader is not needed on Fuchsia because Vulkan is supported on all # SwiftShader is not needed on Fuchsia because Vulkan is supported on all
# devices that run Fuchsia. # devices that run Fuchsia.
angle_swiftshader = !is_android && !is_fuchsia angle_swiftshader = !is_android && !is_fuchsia && !is_ggp
} }
_vulkan_backend_sources = [ _vulkan_backend_sources = [
...@@ -119,7 +119,7 @@ if (is_win) { ...@@ -119,7 +119,7 @@ if (is_win) {
] ]
} }
if (is_linux) { if (angle_use_x11) {
_vulkan_backend_sources += [ _vulkan_backend_sources += [
"xcb/DisplayVkXcb.cpp", "xcb/DisplayVkXcb.cpp",
"xcb/DisplayVkXcb.h", "xcb/DisplayVkXcb.h",
......
...@@ -131,7 +131,7 @@ if (is_win || is_linux || is_mac || is_android || is_fuchsia) { ...@@ -131,7 +131,7 @@ if (is_win || is_linux || is_mac || is_android || is_fuchsia) {
if (is_win) { if (is_win) {
sources += angle_end2end_tests_win_sources sources += angle_end2end_tests_win_sources
} }
if (use_x11) { if (angle_use_x11) {
sources += angle_end2end_tests_x11_sources sources += angle_end2end_tests_x11_sources
} }
if (angle_enable_vulkan) { if (angle_enable_vulkan) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment