2015-09-01 17:32:30 +03:00
|
|
|
# Copyright 2014-2015 The Chromium Authors. All rights reserved.
|
2014-06-23 23:13:02 +04:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2015-05-26 18:32:58 +03:00
|
|
|
# import the use_x11 variable
|
2016-05-27 15:35:36 +03:00
|
|
|
import("//build/config/dcheck_always_on.gni")
|
2016-06-13 23:39:01 +03:00
|
|
|
import("//build/config/linux/pkg_config.gni")
|
2015-05-26 18:32:58 +03:00
|
|
|
import("//build/config/ui.gni")
|
2016-06-16 17:24:50 +03:00
|
|
|
import("//testing/libfuzzer/fuzzer_test.gni")
|
2017-08-29 05:53:24 +03:00
|
|
|
import("gni/angle.gni")
|
2015-05-26 18:32:58 +03:00
|
|
|
|
2017-03-20 20:06:19 +03:00
|
|
|
declare_args() {
|
|
|
|
# Use the PCI lib to collect GPU information on Linux.
|
|
|
|
use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) &&
|
|
|
|
(use_x11 || use_ozone)
|
2017-12-12 07:58:53 +03:00
|
|
|
|
|
|
|
# Link in system libGL, to work with apitrace. See doc/DebuggingTips.md.
|
|
|
|
angle_link_glx = false
|
2017-03-20 20:06:19 +03:00
|
|
|
}
|
|
|
|
|
2017-08-29 05:53:24 +03:00
|
|
|
if (!build_with_chromium) {
|
|
|
|
group("all") {
|
|
|
|
testonly = true
|
|
|
|
deps = [
|
|
|
|
":angle_shader_translator",
|
|
|
|
":translator_fuzzer",
|
|
|
|
"//samples:all",
|
|
|
|
"//src/tests:all",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-07 20:17:47 +03:00
|
|
|
if (ozone_platform_gbm) {
|
2016-06-28 00:08:28 +03:00
|
|
|
pkg_config("libdrm") {
|
|
|
|
packages = [ "libdrm" ]
|
|
|
|
}
|
2016-06-13 23:39:01 +03:00
|
|
|
}
|
|
|
|
|
2015-07-30 15:34:54 +03:00
|
|
|
angle_git_is_present = exec_script("src/commit_id.py",
|
|
|
|
[
|
|
|
|
"check",
|
|
|
|
rebase_path(".", root_build_dir),
|
|
|
|
],
|
|
|
|
"value")
|
|
|
|
|
|
|
|
angle_use_commit_id = angle_git_is_present == 1
|
|
|
|
|
2016-01-04 19:25:00 +03:00
|
|
|
gles_gypi = exec_script("//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("src/libGLESv2.gypi") ],
|
|
|
|
"scope",
|
|
|
|
[ "src/libGLESv2.gypi" ])
|
|
|
|
|
|
|
|
compiler_gypi = exec_script("//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("src/compiler.gypi") ],
|
|
|
|
"scope",
|
|
|
|
[ "src/compiler.gypi" ])
|
2014-07-17 01:19:18 +04:00
|
|
|
|
2014-07-23 04:00:17 +04:00
|
|
|
# This config is exported to dependent targets (and also applied to internal
|
|
|
|
# ones).
|
|
|
|
config("external_config") {
|
2016-01-04 19:25:00 +03:00
|
|
|
include_dirs = [ "include" ]
|
2014-07-23 04:00:17 +04:00
|
|
|
}
|
|
|
|
|
2014-06-23 23:13:02 +04:00
|
|
|
# This config is applied to internal Angle targets (not pushed to dependents).
|
|
|
|
config("internal_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
2017-01-03 19:03:23 +03:00
|
|
|
|
|
|
|
# Prevent the GL headers from redeclaring ANGLE entry points.
|
|
|
|
defines = [
|
|
|
|
"GL_GLEXT_PROTOTYPES",
|
|
|
|
"EGL_EGLEXT_PROTOTYPES",
|
|
|
|
]
|
2017-04-12 16:53:01 +03:00
|
|
|
|
2017-10-26 00:02:29 +03:00
|
|
|
if (current_cpu == "x86" || current_cpu == "arm") {
|
|
|
|
defines += [ "ANGLE_IS_32_BIT_CPU" ]
|
2017-04-12 16:53:01 +03:00
|
|
|
}
|
2017-10-26 00:02:29 +03:00
|
|
|
if (current_cpu == "x64" || current_cpu == "arm64") {
|
|
|
|
defines += [ "ANGLE_IS_64_BIT_CPU" ]
|
2017-04-12 16:53:01 +03:00
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2016-07-18 17:10:29 +03:00
|
|
|
config("extra_warnings") {
|
2017-10-11 06:53:20 +03:00
|
|
|
cflags = []
|
2017-08-29 05:53:24 +03:00
|
|
|
|
2016-07-18 17:10:29 +03:00
|
|
|
# Enable more default warnings on Windows.
|
|
|
|
if (is_win) {
|
2017-10-11 06:53:20 +03:00
|
|
|
cflags += [
|
2016-07-18 17:10:29 +03:00
|
|
|
"/we4244", # Conversion: possible loss of data.
|
|
|
|
"/we4456", # Variable shadowing.
|
2016-09-22 20:53:47 +03:00
|
|
|
"/we4458", # declaration hides class member.
|
2017-11-28 21:26:34 +03:00
|
|
|
"/we4800", # forcing value to bool.
|
|
|
|
"/we4838", # narrowing conversion.
|
2016-07-18 17:10:29 +03:00
|
|
|
]
|
|
|
|
}
|
2017-10-11 06:53:20 +03:00
|
|
|
if (is_clang) {
|
|
|
|
# Remove when crbug.com/428099 is resolved.
|
2017-08-29 05:53:24 +03:00
|
|
|
cflags += [ "-Winconsistent-missing-override" ]
|
2017-10-11 06:53:20 +03:00
|
|
|
}
|
2016-07-18 17:10:29 +03:00
|
|
|
}
|
|
|
|
|
2015-02-25 16:34:49 +03:00
|
|
|
if (is_win) {
|
|
|
|
copy("copy_compiler_dll") {
|
2016-01-04 19:25:00 +03:00
|
|
|
sources = [
|
|
|
|
"$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/d3dcompiler_47.dll",
|
|
|
|
]
|
2015-02-25 16:34:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-18 20:47:12 +03:00
|
|
|
angle_undefine_configs = [ "//build/config/compiler:default_include_dirs" ]
|
2016-06-02 20:04:10 +03:00
|
|
|
|
2014-06-23 23:13:02 +04:00
|
|
|
# Holds the shared includes so we only need to list them once.
|
|
|
|
source_set("includes") {
|
2017-11-14 00:57:14 +03:00
|
|
|
sources = rebase_path(gles_gypi.libangle_includes, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static_library("preprocessor") {
|
2014-07-17 01:19:18 +04:00
|
|
|
sources = rebase_path(compiler_gypi.angle_preprocessor_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
configs -= angle_undefine_configs
|
2017-10-11 22:08:22 +03:00
|
|
|
configs += [
|
|
|
|
":extra_warnings",
|
|
|
|
":internal_config",
|
|
|
|
]
|
2016-09-21 00:15:59 +03:00
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
":angle_common",
|
|
|
|
]
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2016-09-19 16:54:44 +03:00
|
|
|
config("translator_disable_pool_alloc") {
|
|
|
|
defines = [ "ANGLE_TRANSLATOR_DISABLE_POOL_ALLOC" ]
|
2014-08-07 20:31:38 +04:00
|
|
|
}
|
|
|
|
|
2015-06-17 01:03:14 +03:00
|
|
|
config("debug_annotations_config") {
|
|
|
|
if (is_debug) {
|
2016-01-04 19:25:00 +03:00
|
|
|
defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
|
2015-06-17 01:03:14 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-27 15:35:36 +03:00
|
|
|
config("angle_release_asserts_config") {
|
|
|
|
if (dcheck_always_on) {
|
|
|
|
defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
config("angle_common_config") {
|
2017-06-07 21:59:51 +03:00
|
|
|
include_dirs = [ "src/common/third_party/base" ]
|
2016-06-02 20:04:10 +03:00
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
static_library("angle_common") {
|
|
|
|
sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src")
|
2015-06-17 01:03:14 +03:00
|
|
|
|
2017-01-05 22:47:34 +03:00
|
|
|
if (is_linux || is_android) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_common_linux_sources, ".", "src")
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_mac) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_common_mac_sources, ".", "src")
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_common_win_sources, ".", "src")
|
|
|
|
}
|
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
configs -= angle_undefine_configs
|
2015-01-14 22:31:02 +03:00
|
|
|
configs += [
|
2016-06-02 20:04:10 +03:00
|
|
|
":angle_common_config",
|
2015-06-17 01:03:14 +03:00
|
|
|
":debug_annotations_config",
|
2016-07-18 17:10:29 +03:00
|
|
|
":extra_warnings",
|
2016-06-02 20:04:10 +03:00
|
|
|
":internal_config",
|
2015-01-14 22:31:02 +03:00
|
|
|
]
|
2016-04-06 23:39:52 +03:00
|
|
|
|
2016-05-20 00:59:55 +03:00
|
|
|
public_deps = [
|
|
|
|
":commit_id",
|
|
|
|
]
|
2017-04-26 23:46:48 +03:00
|
|
|
public_configs = [ ":angle_common_config" ]
|
|
|
|
all_dependent_configs = [ ":angle_release_asserts_config" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
|
|
|
|
2016-06-13 22:06:31 +03:00
|
|
|
config("angle_image_util_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2016-07-14 04:01:55 +03:00
|
|
|
static_library("angle_image_util") {
|
2016-06-13 22:06:31 +03:00
|
|
|
sources = rebase_path(gles_gypi.libangle_image_util_sources, ".", "src")
|
|
|
|
|
|
|
|
configs -= angle_undefine_configs
|
2017-02-15 21:57:16 +03:00
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
":extra_warnings",
|
|
|
|
]
|
2016-06-13 22:06:31 +03:00
|
|
|
|
|
|
|
public_configs = [ ":angle_image_util_config" ]
|
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
":angle_common",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-02-08 18:43:47 +03:00
|
|
|
config("angle_gpu_info_util_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("angle_gpu_info_util") {
|
|
|
|
configs -= angle_undefine_configs
|
2017-02-15 21:57:16 +03:00
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
":extra_warnings",
|
|
|
|
]
|
2017-02-08 18:43:47 +03:00
|
|
|
|
|
|
|
public_configs = [ ":angle_gpu_info_util_config" ]
|
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
":angle_common",
|
|
|
|
]
|
|
|
|
|
|
|
|
sources = rebase_path(gles_gypi.libangle_gpu_info_util_sources, ".", "src")
|
|
|
|
deps = []
|
|
|
|
libs = []
|
|
|
|
defines = []
|
|
|
|
|
2017-03-24 21:58:59 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources +=
|
|
|
|
rebase_path(gles_gypi.libangle_gpu_info_util_win_sources, ".", "src")
|
|
|
|
libs += [ "setupapi.lib" ]
|
|
|
|
defines += [ "GPU_INFO_USE_SETUPAPI" ]
|
|
|
|
}
|
|
|
|
|
2017-02-08 18:43:47 +03:00
|
|
|
if (is_linux) {
|
|
|
|
sources +=
|
|
|
|
rebase_path(gles_gypi.libangle_gpu_info_util_linux_sources, ".", "src")
|
|
|
|
|
|
|
|
if (use_x11) {
|
2017-02-15 21:57:16 +03:00
|
|
|
sources +=
|
|
|
|
rebase_path(gles_gypi.libangle_gpu_info_util_x11_sources, ".", "src")
|
2017-02-08 18:43:47 +03:00
|
|
|
deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
|
|
|
|
defines += [ "GPU_INFO_USE_X11" ]
|
|
|
|
libs += [
|
|
|
|
"X11",
|
|
|
|
"Xi",
|
|
|
|
"Xext",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (use_libpci) {
|
|
|
|
sources +=
|
|
|
|
rebase_path(gles_gypi.libangle_gpu_info_util_libpci_sources, ".", "src")
|
|
|
|
defines += [ "GPU_INFO_USE_LIBPCI" ]
|
|
|
|
libs += [ "pci" ]
|
|
|
|
}
|
2017-02-16 18:58:46 +03:00
|
|
|
|
|
|
|
if (is_mac) {
|
|
|
|
sources +=
|
|
|
|
rebase_path(gles_gypi.libangle_gpu_info_util_mac_sources, ".", "src")
|
|
|
|
libs += [
|
|
|
|
"IOKit.framework",
|
|
|
|
"CoreFoundation.framework",
|
2017-10-11 18:38:55 +03:00
|
|
|
"CoreGraphics.framework",
|
2017-02-16 18:58:46 +03:00
|
|
|
]
|
|
|
|
}
|
2017-02-08 18:43:47 +03:00
|
|
|
}
|
|
|
|
|
2016-11-11 01:33:43 +03:00
|
|
|
static_library("translator") {
|
2016-11-12 00:05:11 +03:00
|
|
|
sources = rebase_path(compiler_gypi.angle_translator_sources, ".", "src")
|
2015-12-11 20:30:15 +03:00
|
|
|
defines = []
|
|
|
|
|
2017-10-10 02:14:06 +03:00
|
|
|
if (angle_enable_essl || use_fuzzing_engine) {
|
2016-01-04 19:25:00 +03:00
|
|
|
sources +=
|
2016-11-12 00:05:11 +03:00
|
|
|
rebase_path(compiler_gypi.angle_translator_essl_sources, ".", "src")
|
2015-12-11 20:30:15 +03:00
|
|
|
defines += [ "ANGLE_ENABLE_ESSL" ]
|
|
|
|
}
|
|
|
|
|
2017-10-10 02:14:06 +03:00
|
|
|
if (angle_enable_glsl || use_fuzzing_engine) {
|
2016-01-04 19:25:00 +03:00
|
|
|
sources +=
|
2016-11-12 00:05:11 +03:00
|
|
|
rebase_path(compiler_gypi.angle_translator_glsl_sources, ".", "src")
|
2015-12-11 20:30:15 +03:00
|
|
|
defines += [ "ANGLE_ENABLE_GLSL" ]
|
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2017-10-10 02:14:06 +03:00
|
|
|
if (angle_enable_hlsl || use_fuzzing_engine) {
|
2016-01-04 19:25:00 +03:00
|
|
|
sources +=
|
2016-11-12 00:05:11 +03:00
|
|
|
rebase_path(compiler_gypi.angle_translator_hlsl_sources, ".", "src")
|
2015-12-11 20:30:15 +03:00
|
|
|
defines += [ "ANGLE_ENABLE_HLSL" ]
|
2015-02-25 16:34:49 +03:00
|
|
|
}
|
2017-01-14 01:29:51 +03:00
|
|
|
|
2017-10-10 02:14:06 +03:00
|
|
|
if (angle_enable_vulkan || use_fuzzing_engine) {
|
2017-01-14 01:29:51 +03:00
|
|
|
sources += rebase_path(compiler_gypi.angle_translator_lib_vulkan_sources,
|
|
|
|
".",
|
|
|
|
"src")
|
|
|
|
defines += [ "ANGLE_ENABLE_VULKAN" ]
|
|
|
|
}
|
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
configs -= angle_undefine_configs
|
2017-10-11 22:08:22 +03:00
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
":extra_warnings",
|
|
|
|
]
|
2014-09-24 21:20:56 +04:00
|
|
|
public_configs = [ ":external_config" ]
|
2017-10-10 02:14:06 +03:00
|
|
|
if (use_fuzzing_engine) {
|
2016-09-19 16:54:44 +03:00
|
|
|
all_dependent_configs = [ ":translator_disable_pool_alloc" ]
|
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":preprocessor",
|
|
|
|
]
|
2015-01-14 22:31:02 +03:00
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
":angle_common",
|
|
|
|
]
|
2016-07-18 20:47:12 +03:00
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
# Necessary to suppress some system header xtree warnigns in Release.
|
|
|
|
# For some reason this warning doesn't get triggered in Chromium
|
|
|
|
cflags = [ "/wd4718" ]
|
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2016-09-16 17:29:54 +03:00
|
|
|
source_set("translator_fuzzer") {
|
2016-06-16 17:24:50 +03:00
|
|
|
sources = [
|
|
|
|
"src/compiler/fuzz/translator_fuzzer.cpp",
|
|
|
|
]
|
|
|
|
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
2016-11-02 01:19:06 +03:00
|
|
|
":translator",
|
2016-06-16 17:24:50 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2014-06-23 23:13:02 +04:00
|
|
|
config("commit_id_config") {
|
|
|
|
include_dirs = [ "$root_gen_dir/angle" ]
|
|
|
|
}
|
|
|
|
|
2015-07-30 15:34:54 +03:00
|
|
|
commit_id_output_file = "$root_gen_dir/angle/id/commit.h"
|
|
|
|
if (angle_use_commit_id) {
|
|
|
|
action("commit_id") {
|
|
|
|
script = "src/commit_id.py"
|
|
|
|
outputs = [
|
|
|
|
commit_id_output_file,
|
|
|
|
]
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2015-07-30 15:34:54 +03:00
|
|
|
args = [
|
|
|
|
"gen",
|
|
|
|
rebase_path(".", root_build_dir),
|
|
|
|
rebase_path(commit_id_output_file, root_build_dir),
|
|
|
|
]
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2015-07-30 15:34:54 +03:00
|
|
|
public_configs = [ ":commit_id_config" ]
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
copy("commit_id") {
|
|
|
|
sources = [
|
|
|
|
"src/commit.h",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
commit_id_output_file,
|
|
|
|
]
|
|
|
|
public_configs = [ ":commit_id_config" ]
|
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
config("libANGLE_config") {
|
2015-02-12 21:39:56 +03:00
|
|
|
cflags = []
|
2015-01-14 22:31:02 +03:00
|
|
|
defines = []
|
|
|
|
if (angle_enable_d3d9) {
|
|
|
|
defines += [ "ANGLE_ENABLE_D3D9" ]
|
|
|
|
}
|
|
|
|
if (angle_enable_d3d11) {
|
|
|
|
defines += [ "ANGLE_ENABLE_D3D11" ]
|
2014-11-19 22:20:15 +03:00
|
|
|
}
|
2015-02-13 23:41:41 +03:00
|
|
|
if (angle_enable_gl) {
|
|
|
|
defines += [ "ANGLE_ENABLE_OPENGL" ]
|
2016-05-05 20:37:38 +03:00
|
|
|
if (use_x11) {
|
|
|
|
defines += [ "ANGLE_USE_X11" ]
|
|
|
|
}
|
2017-10-22 05:19:40 +03:00
|
|
|
if (angle_enable_gl_null) {
|
|
|
|
defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
|
|
|
|
}
|
2015-05-26 18:32:58 +03:00
|
|
|
}
|
2016-05-25 19:57:39 +03:00
|
|
|
if (angle_enable_vulkan) {
|
|
|
|
defines += [ "ANGLE_ENABLE_VULKAN" ]
|
|
|
|
}
|
2016-09-23 22:56:30 +03:00
|
|
|
if (angle_enable_null) {
|
|
|
|
defines += [ "ANGLE_ENABLE_NULL" ]
|
|
|
|
}
|
2017-01-03 19:03:23 +03:00
|
|
|
defines += [ "LIBANGLE_IMPLEMENTATION" ]
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2015-02-12 21:39:56 +03:00
|
|
|
if (is_win) {
|
|
|
|
cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled.
|
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2014-11-19 22:20:15 +03:00
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
static_library("libANGLE") {
|
|
|
|
sources = rebase_path(gles_gypi.libangle_sources, ".", "src")
|
|
|
|
|
2017-06-07 21:59:51 +03:00
|
|
|
include_dirs = []
|
2015-01-14 22:31:02 +03:00
|
|
|
libs = []
|
2016-11-11 16:25:44 +03:00
|
|
|
defines = []
|
2017-12-12 07:58:53 +03:00
|
|
|
if (angle_link_glx) {
|
|
|
|
libs += [ "GL" ]
|
|
|
|
defines += [ "ANGLE_LINK_GLX" ]
|
|
|
|
}
|
2016-06-02 20:04:10 +03:00
|
|
|
public_deps = [
|
2016-03-01 00:37:04 +03:00
|
|
|
":angle_common",
|
2016-06-02 20:04:10 +03:00
|
|
|
]
|
|
|
|
deps = [
|
2017-02-08 18:43:47 +03:00
|
|
|
":angle_gpu_info_util",
|
2017-02-15 21:57:16 +03:00
|
|
|
":angle_image_util",
|
2016-03-01 00:37:04 +03:00
|
|
|
":commit_id",
|
|
|
|
":includes",
|
2016-11-02 01:19:06 +03:00
|
|
|
":translator",
|
2016-03-01 00:37:04 +03:00
|
|
|
]
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
# Shared D3D sources.
|
|
|
|
if (angle_enable_d3d9 || angle_enable_d3d11) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_d3d_shared_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2016-01-04 19:25:00 +03:00
|
|
|
defines += [ "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2014-11-19 22:20:15 +03:00
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (angle_enable_d3d9) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_d3d9_sources, ".", "src")
|
|
|
|
libs += [ "d3d9.lib" ]
|
2015-01-09 19:51:16 +03:00
|
|
|
}
|
2015-01-07 21:22:02 +03:00
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (angle_enable_d3d11) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_d3d11_sources, ".", "src")
|
|
|
|
sources += rebase_path(gles_gypi.libangle_d3d11_win32_sources, ".", "src")
|
2016-08-23 19:29:22 +03:00
|
|
|
libs += [ "dxguid.lib" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2015-01-07 21:22:02 +03:00
|
|
|
|
2015-02-13 23:41:41 +03:00
|
|
|
if (angle_enable_gl) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_sources, ".", "src")
|
|
|
|
include_dirs += [ "src/third_party/khronos" ]
|
|
|
|
|
2017-10-22 05:19:40 +03:00
|
|
|
if (angle_enable_gl_null) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_null_sources, ".", "src")
|
|
|
|
}
|
2015-02-13 23:41:41 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_wgl_sources, ".", "src")
|
|
|
|
}
|
2015-05-26 18:32:58 +03:00
|
|
|
if (use_x11) {
|
2015-05-14 17:54:18 +03:00
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_glx_sources, ".", "src")
|
2016-05-20 00:59:55 +03:00
|
|
|
deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
|
2016-03-01 00:37:04 +03:00
|
|
|
libs += [
|
|
|
|
"X11",
|
|
|
|
"Xi",
|
|
|
|
"Xext",
|
|
|
|
]
|
2015-05-14 17:54:18 +03:00
|
|
|
}
|
2016-05-14 00:27:57 +03:00
|
|
|
if (is_mac) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_cgl_sources, ".", "src")
|
|
|
|
libs += [
|
|
|
|
"Cocoa.framework",
|
|
|
|
"IOSurface.framework",
|
|
|
|
"OpenGL.framework",
|
|
|
|
"QuartzCore.framework",
|
|
|
|
]
|
|
|
|
}
|
2016-06-03 07:18:38 +03:00
|
|
|
if (is_android) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src")
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src")
|
|
|
|
sources +=
|
|
|
|
rebase_path(gles_gypi.libangle_gl_egl_android_sources, ".", "src")
|
|
|
|
libs += [
|
|
|
|
"android",
|
|
|
|
"log",
|
|
|
|
]
|
|
|
|
}
|
2016-07-07 20:17:47 +03:00
|
|
|
if (ozone_platform_gbm) {
|
2016-06-13 23:39:01 +03:00
|
|
|
configs += [ ":libdrm" ]
|
|
|
|
defines += [ "ANGLE_USE_OZONE" ]
|
|
|
|
deps += [ "//third_party/minigbm" ]
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src")
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src")
|
|
|
|
sources += rebase_path(gles_gypi.libangle_gl_ozone_sources, ".", "src")
|
|
|
|
}
|
2015-02-13 23:41:41 +03:00
|
|
|
}
|
|
|
|
|
2016-05-25 19:57:39 +03:00
|
|
|
if (angle_enable_vulkan) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_vulkan_sources, ".", "src")
|
2016-11-24 05:05:36 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources +=
|
|
|
|
rebase_path(gles_gypi.libangle_vulkan_win32_sources, ".", "src")
|
|
|
|
}
|
|
|
|
if (is_linux) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_vulkan_xcb_sources, ".", "src")
|
|
|
|
}
|
2017-08-29 05:53:24 +03:00
|
|
|
deps += [ "src/vulkan_support:angle_vulkan" ]
|
2016-05-25 19:57:39 +03:00
|
|
|
}
|
|
|
|
|
2016-09-23 22:56:30 +03:00
|
|
|
if (angle_enable_null) {
|
|
|
|
sources += rebase_path(gles_gypi.libangle_null_sources, ".", "src")
|
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (is_debug) {
|
2016-01-04 19:25:00 +03:00
|
|
|
defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2015-01-07 21:22:02 +03:00
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
configs -= angle_undefine_configs
|
2016-07-18 20:47:12 +03:00
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
configs += [
|
|
|
|
":commit_id_config",
|
2015-06-17 01:03:14 +03:00
|
|
|
":debug_annotations_config",
|
2016-07-18 17:10:29 +03:00
|
|
|
":extra_warnings",
|
2015-01-14 22:31:02 +03:00
|
|
|
":internal_config",
|
|
|
|
]
|
2015-01-13 19:13:56 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
public_configs = [ ":libANGLE_config" ]
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (is_win) {
|
2016-06-02 20:04:10 +03:00
|
|
|
data_deps = [
|
|
|
|
":copy_compiler_dll",
|
|
|
|
]
|
2015-01-14 01:52:17 +03:00
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2015-01-13 19:13:56 +03:00
|
|
|
|
2016-06-21 18:47:03 +03:00
|
|
|
config("shared_library_public_config") {
|
|
|
|
if (is_mac && !is_component_build) {
|
|
|
|
# Executable targets that depend on the shared libraries below need to have
|
|
|
|
# the rpath setup in non-component build configurations.
|
2016-07-18 20:47:12 +03:00
|
|
|
ldflags = [
|
|
|
|
"-rpath",
|
|
|
|
"@executable_path/",
|
|
|
|
]
|
2016-06-21 18:47:03 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
# This config controls export definitions on ANGLE API calls.
|
|
|
|
config("angle_static") {
|
|
|
|
defines = [
|
|
|
|
"ANGLE_EXPORT=",
|
|
|
|
"EGLAPI=",
|
|
|
|
"GL_APICALL=",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
shared_library("libGLESv2") {
|
|
|
|
sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src")
|
2015-01-13 19:13:56 +03:00
|
|
|
|
2017-01-16 17:44:49 +03:00
|
|
|
if (is_android) {
|
|
|
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (is_win) {
|
2016-01-04 19:25:00 +03:00
|
|
|
ldflags =
|
|
|
|
[ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ]
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2015-01-13 19:13:56 +03:00
|
|
|
|
2016-06-21 18:47:03 +03:00
|
|
|
if (is_mac && !is_component_build) {
|
2016-07-18 20:47:12 +03:00
|
|
|
ldflags = [
|
|
|
|
"-install_name",
|
|
|
|
"@rpath/${target_name}.dylib",
|
|
|
|
]
|
2016-06-21 18:47:03 +03:00
|
|
|
public_configs = [ ":shared_library_public_config" ]
|
|
|
|
}
|
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
configs -= angle_undefine_configs
|
2015-01-14 22:31:02 +03:00
|
|
|
configs += [
|
|
|
|
":commit_id_config",
|
2015-06-17 01:03:14 +03:00
|
|
|
":debug_annotations_config",
|
2017-10-11 22:08:22 +03:00
|
|
|
":extra_warnings",
|
2017-01-03 19:03:23 +03:00
|
|
|
":internal_config",
|
2015-01-14 22:31:02 +03:00
|
|
|
]
|
2015-01-13 19:13:56 +03:00
|
|
|
|
2016-01-04 19:25:00 +03:00
|
|
|
defines = [ "LIBGLESV2_IMPLEMENTATION" ]
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_win) {
|
|
|
|
defines += [ "GL_APICALL=" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "GL_APICALL=__attribute__((visibility(\"default\")))" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":libANGLE",
|
2017-05-25 06:39:28 +03:00
|
|
|
"//build/config:exe_and_shlib_deps",
|
2017-01-03 19:03:23 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("libGLESv2_static") {
|
|
|
|
sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src")
|
|
|
|
|
|
|
|
configs -= angle_undefine_configs
|
|
|
|
configs += [
|
|
|
|
":commit_id_config",
|
|
|
|
":debug_annotations_config",
|
2017-10-11 22:08:22 +03:00
|
|
|
":extra_warnings",
|
2017-01-03 19:03:23 +03:00
|
|
|
":internal_config",
|
|
|
|
]
|
|
|
|
|
|
|
|
public_configs = [ ":angle_static" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":libANGLE",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
shared_library("libEGL") {
|
|
|
|
sources = rebase_path(gles_gypi.libegl_sources, ".", "src")
|
|
|
|
|
2017-01-16 17:44:49 +03:00
|
|
|
if (is_android) {
|
|
|
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
|
|
|
}
|
2017-01-03 19:03:23 +03:00
|
|
|
configs -= angle_undefine_configs
|
|
|
|
configs += [
|
|
|
|
":commit_id_config",
|
|
|
|
":debug_annotations_config",
|
|
|
|
":extra_warnings",
|
|
|
|
":internal_config",
|
|
|
|
]
|
|
|
|
|
|
|
|
defines = [ "LIBEGL_IMPLEMENTATION" ]
|
|
|
|
if (is_win) {
|
|
|
|
defines += [ "EGLAPI=" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
|
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (is_win) {
|
2016-01-04 19:25:00 +03:00
|
|
|
ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ]
|
2015-01-14 01:52:17 +03:00
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
|
2016-06-21 18:47:03 +03:00
|
|
|
if (is_mac && !is_component_build) {
|
2016-07-18 20:47:12 +03:00
|
|
|
ldflags = [
|
|
|
|
"-install_name",
|
|
|
|
"@rpath/${target_name}.dylib",
|
|
|
|
]
|
2016-06-21 18:47:03 +03:00
|
|
|
public_configs = [ ":shared_library_public_config" ]
|
|
|
|
}
|
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":libGLESv2",
|
2017-05-25 06:39:28 +03:00
|
|
|
"//build/config:exe_and_shlib_deps",
|
2017-01-03 19:03:23 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("libEGL_static") {
|
|
|
|
sources = rebase_path(gles_gypi.libegl_sources, ".", "src")
|
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
configs -= angle_undefine_configs
|
2015-01-14 22:31:02 +03:00
|
|
|
configs += [
|
|
|
|
":commit_id_config",
|
2015-09-02 17:30:55 +03:00
|
|
|
":debug_annotations_config",
|
2016-07-18 17:10:29 +03:00
|
|
|
":extra_warnings",
|
|
|
|
":internal_config",
|
2015-01-14 22:31:02 +03:00
|
|
|
]
|
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
public_configs = [ ":angle_static" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
2017-01-03 19:03:23 +03:00
|
|
|
":libGLESv2_static",
|
2015-01-14 22:31:02 +03:00
|
|
|
]
|
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2016-01-04 19:25:00 +03:00
|
|
|
util_gypi = exec_script("//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("util/util.gyp") ],
|
|
|
|
"scope",
|
|
|
|
[ "util/util.gyp" ])
|
|
|
|
|
|
|
|
config("angle_util_config") {
|
|
|
|
include_dirs = [ "util" ]
|
2016-06-13 23:39:01 +03:00
|
|
|
if (is_linux && use_x11) {
|
2016-01-07 22:33:48 +03:00
|
|
|
libs = [ "X11" ]
|
|
|
|
}
|
2016-01-04 19:25:00 +03:00
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
foreach(is_shared_library,
|
|
|
|
[
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
]) {
|
|
|
|
if (is_shared_library) {
|
|
|
|
library_type = "shared_library"
|
|
|
|
library_name = "angle_util"
|
|
|
|
dep_suffix = ""
|
|
|
|
} else {
|
|
|
|
library_type = "static_library"
|
|
|
|
library_name = "angle_util_static"
|
|
|
|
dep_suffix = "_static"
|
2015-09-02 17:30:55 +03:00
|
|
|
}
|
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
target(library_type, library_name) {
|
|
|
|
sources = rebase_path(util_gypi.util_sources, ".", "util")
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources += rebase_path(util_gypi.util_win32_sources, ".", "util")
|
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_linux) {
|
|
|
|
sources += rebase_path(util_gypi.util_linux_sources, ".", "util")
|
|
|
|
libs = [
|
|
|
|
"rt",
|
|
|
|
"dl",
|
|
|
|
]
|
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_mac) {
|
|
|
|
sources += rebase_path(util_gypi.util_osx_sources, ".", "util")
|
|
|
|
libs = [
|
|
|
|
"AppKit.framework",
|
|
|
|
"QuartzCore.framework",
|
|
|
|
]
|
|
|
|
}
|
2016-06-03 07:18:38 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (use_x11) {
|
|
|
|
sources += rebase_path(util_gypi.util_x11_sources, ".", "util")
|
|
|
|
}
|
2016-06-13 23:39:01 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_android) {
|
2017-01-16 17:44:49 +03:00
|
|
|
if (is_shared_library) {
|
|
|
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
|
|
|
}
|
2017-02-08 18:43:47 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
# To prevent linux sources filtering on android
|
|
|
|
set_sources_assignment_filter([])
|
|
|
|
sources += rebase_path(util_gypi.util_linux_sources, ".", "util")
|
|
|
|
sources += rebase_path(util_gypi.util_android_sources, ".", "util")
|
|
|
|
libs = [
|
|
|
|
"android",
|
|
|
|
"log",
|
|
|
|
]
|
|
|
|
}
|
2015-09-15 20:12:07 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (use_ozone) {
|
|
|
|
sources += rebase_path(util_gypi.util_ozone_sources, ".", "util")
|
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
configs += [
|
|
|
|
":debug_annotations_config",
|
|
|
|
":extra_warnings",
|
2016-08-13 03:40:14 +03:00
|
|
|
]
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
public_configs = [
|
|
|
|
":angle_util_config",
|
|
|
|
":internal_config",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":angle_common",
|
|
|
|
":libEGL${dep_suffix}",
|
|
|
|
":libGLESv2${dep_suffix}",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (is_shared_library) {
|
|
|
|
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
|
|
|
|
|
2017-05-25 06:39:28 +03:00
|
|
|
deps += [ "//build/config:exe_and_shlib_deps" ]
|
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_mac && !is_component_build) {
|
|
|
|
ldflags = [
|
|
|
|
"-install_name",
|
|
|
|
"@rpath/lib${target_name}.dylib",
|
|
|
|
]
|
|
|
|
public_configs += [ ":shared_library_public_config" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
}
|
2017-06-29 00:01:15 +03:00
|
|
|
|
|
|
|
# Convenience targets for some of the samples so they can be built
|
|
|
|
# with Chromium's toolchain.
|
|
|
|
|
|
|
|
executable("angle_shader_translator") {
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
sources = [
|
2017-06-30 04:25:56 +03:00
|
|
|
"samples/shader_translator/shader_translator.cpp",
|
2017-06-29 00:01:15 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
2017-06-30 04:25:56 +03:00
|
|
|
":translator",
|
|
|
|
"//build/config:exe_and_shlib_deps",
|
2017-06-29 00:01:15 +03:00
|
|
|
]
|
|
|
|
}
|