Commit 51e2ad14 by Corentin Wallez

Do not always use X11 for Linux builds, inherit Chromium's settings

This fixes project generation for Chromium for non-X11 builds BUG=angleproject:1011 Change-Id: If528f63fb186d834d56a43ca379497d99e74777e Reviewed-on: https://chromium-review.googlesource.com/273163Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 44aedf37
......@@ -2,6 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# import the use_x11 variable
import("//build/config/ui.gni")
gles_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("src/libGLESv2.gypi") ],
......@@ -197,6 +200,9 @@ config("libANGLE_config") {
if (angle_enable_gl) {
defines += [ "ANGLE_ENABLE_OPENGL" ]
}
if (use_x11) {
defines += [ "ANGLE_USE_X11" ]
}
defines += [
"GL_APICALL=",
"GL_GLEXT_PROTOTYPES=",
......@@ -244,7 +250,7 @@ static_library("libANGLE") {
if (is_win) {
sources += rebase_path(gles_gypi.libangle_gl_wgl_sources, ".", "src")
}
if (is_linux) {
if (use_x11) {
sources += rebase_path(gles_gypi.libangle_gl_glx_sources, ".", "src")
libs += [ "X11" ]
}
......
......@@ -10,6 +10,14 @@
'angle_build_winrt%': '0',
'angle_build_winphone%': '0',
'angle_build_winrt_app_type_revision%': '8.1',
'use_x11%': 0,
'conditions':
[
['OS=="linux"',
{
'use_x11%': 1,
}],
],
},
'msvs_disabled_warnings':
[
......
......@@ -47,16 +47,6 @@
'sample_util/tga_utils.cpp',
'sample_util/tga_utils.h',
],
'conditions':
[
['OS=="linux"',
{
'ldflags':
[
'-lX11'
],
}],
],
'msvs_disabled_warnings': [ 4201 ],
'direct_dependent_settings':
{
......
......@@ -36,7 +36,7 @@
#if defined(ANGLE_ENABLE_OPENGL)
# if defined(ANGLE_PLATFORM_WINDOWS)
# include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
# elif defined(ANGLE_PLATFORM_LINUX)
# elif defined(ANGLE_USE_X11)
# include "libANGLE/renderer/gl/glx/DisplayGLX.h"
# else
# error Unsupported OpenGL platform.
......@@ -110,7 +110,7 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap)
#if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11)
// Default to D3D displays
impl = new rx::DisplayD3D();
#elif defined(ANGLE_PLATFORM_LINUX)
#elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX();
#else
// No display available
......@@ -132,7 +132,7 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap)
#if defined(ANGLE_ENABLE_OPENGL)
#if defined(ANGLE_PLATFORM_WINDOWS)
impl = new rx::DisplayWGL();
#elif defined(ANGLE_PLATFORM_LINUX)
#elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX();
#else
#error Unsupported OpenGL platform.
......
......@@ -549,6 +549,13 @@
'ANGLE_ENABLE_OPENGL',
],
}],
['use_x11==1',
{
'defines':
[
'ANGLE_USE_X11',
]
}],
],
},
'conditions':
......@@ -658,7 +665,7 @@
'<@(libangle_gl_wgl_sources)',
],
}],
['OS=="linux"',
['use_x11==1',
{
'sources':
[
......@@ -667,6 +674,13 @@
}],
],
}],
['use_x11==1',
{
'defines':
[
'ANGLE_USE_X11',
]
}],
['angle_build_winrt==0 and OS=="win"',
{
'dependencies':
......@@ -749,7 +763,7 @@
{
'msvs_enable_winphone' : '1',
}],
['OS=="linux"',
['use_x11==1',
{
'link_settings': {
'ldflags': [
......
......@@ -36,9 +36,12 @@
'linux/LinuxTimer.cpp',
'linux/LinuxTimer.h',
'posix/Posix_system_utils.cpp',
],
'util_x11_sources':
[
'x11/X11Window.cpp',
'x11/X11Window.h',
]
],
},
'targets':
[
......@@ -89,6 +92,13 @@
[
'<@(util_linux_sources)',
],
}],
['use_x11==1',
{
'sources':
[
'<@(util_x11_sources)',
],
'link_settings': {
'ldflags': [
'<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
......
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