Commit 9b38269c by Corentin Wallez Committed by Jamie Madill

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/274035Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 21ce9b02
......@@ -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" ]
}
......
......@@ -9,6 +9,15 @@
'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
'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':
[
......@@ -20,7 +29,7 @@
# TODO: 4702 doesn't fire on xtree in VS2015 (CTP6). We can remove C4702 after moving to VS2015.
4702, # Unreachable code. Should only fire on system header xtree.
4718, # Recursive call has no side effects. Fires on xtree too.
],
'conditions':
......
......@@ -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':
{
......
......@@ -35,7 +35,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.
......@@ -109,7 +109,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
......@@ -131,7 +131,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.
......
......@@ -547,6 +547,13 @@
'ANGLE_ENABLE_OPENGL',
],
}],
['use_x11==1',
{
'defines':
[
'ANGLE_USE_X11',
]
}],
],
},
'conditions':
......@@ -656,7 +663,7 @@
'<@(libangle_gl_wgl_sources)',
],
}],
['OS=="linux"',
['use_x11==1',
{
'sources':
[
......@@ -665,6 +672,13 @@
}],
],
}],
['use_x11==1',
{
'defines':
[
'ANGLE_USE_X11',
]
}],
['angle_build_winrt==0 and OS=="win"',
{
'dependencies':
......@@ -744,7 +758,7 @@
{
'msvs_enable_winphone' : '1',
}],
['OS=="linux"',
['use_x11==1',
{
'link_settings': {
'ldflags': [
......
......@@ -35,9 +35,12 @@
'linux/Linux_path_utils.cpp',
'linux/LinuxTimer.cpp',
'linux/LinuxTimer.h',
],
'util_x11_sources':
[
'x11/X11Window.cpp',
'x11/X11Window.h',
]
],
},
'targets':
[
......@@ -88,6 +91,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