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")
|
2018-04-13 02:06:48 +03:00
|
|
|
if (is_android) {
|
|
|
|
# android/rules.gni can only be imported for Android targets
|
|
|
|
import("//build/config/android/rules.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
|
|
|
|
|
2018-08-24 05:11:55 +03:00
|
|
|
import("src/libGLESv2.gni")
|
|
|
|
import("src/compiler.gni")
|
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
|
|
|
|
2018-05-19 01:48:50 +03:00
|
|
|
if (angle_64bit_current_cpu) {
|
2017-10-26 00:02:29 +03:00
|
|
|
defines += [ "ANGLE_IS_64_BIT_CPU" ]
|
2018-05-19 01:48:50 +03:00
|
|
|
} else {
|
|
|
|
defines += [ "ANGLE_IS_32_BIT_CPU" ]
|
2017-04-12 16:53:01 +03:00
|
|
|
}
|
2018-08-21 16:48:01 +03:00
|
|
|
|
|
|
|
if (angle_force_thread_safety) {
|
|
|
|
defines += [ "ANGLE_FORCE_THREAD_SAFETY=1" ]
|
|
|
|
}
|
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) {
|
2018-01-31 18:47:14 +03:00
|
|
|
cflags += [
|
|
|
|
# Remove when crbug.com/428099 is resolved.
|
|
|
|
"-Winconsistent-missing-override",
|
2018-04-11 21:14:55 +03:00
|
|
|
"-Wunneeded-internal-declaration",
|
2018-05-09 16:41:39 +03:00
|
|
|
"-Wnon-virtual-dtor",
|
2018-01-31 18:47:14 +03:00
|
|
|
]
|
2017-10-11 06:53:20 +03:00
|
|
|
}
|
2016-07-18 17:10:29 +03:00
|
|
|
}
|
|
|
|
|
2018-05-15 22:35:15 +03:00
|
|
|
# This config adds build-ids to the associated library.
|
|
|
|
# -Wl is a special option that indicates that clang should pass the associated
|
|
|
|
# option --build-id to the linker. This will cause a build-id section to be added
|
|
|
|
# to the associated library. The build-id makes it possible for a debugger to
|
|
|
|
# find the right symbol file to use.
|
|
|
|
config("build_id_config") {
|
|
|
|
ldflags = [ "-Wl,--build-id" ]
|
|
|
|
}
|
|
|
|
|
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") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_includes
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static_library("preprocessor") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = angle_preprocessor_sources
|
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" ]
|
2018-01-28 02:27:07 +03:00
|
|
|
if (is_android) {
|
|
|
|
libs = [ "log" ]
|
|
|
|
}
|
2016-06-02 20:04:10 +03:00
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
static_library("angle_common") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_common_sources
|
2015-06-17 01:03:14 +03:00
|
|
|
|
2018-02-16 00:34:29 +03:00
|
|
|
if (is_linux || is_android || is_fuchsia) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_common_linux_sources
|
2017-01-05 22:47:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (is_mac) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_common_mac_sources
|
2017-01-05 22:47:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (is_win) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_common_win_sources
|
2017-01-05 22:47:34 +03:00
|
|
|
}
|
|
|
|
|
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",
|
2018-02-21 16:28:01 +03:00
|
|
|
":includes",
|
2016-05-20 00:59:55 +03:00
|
|
|
]
|
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") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_image_util_sources
|
2016-06-13 22:06:31 +03:00
|
|
|
|
|
|
|
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",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-08-30 02:04:15 +03:00
|
|
|
config("angle_feature_support_util_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("angle_feature_support_util") {
|
|
|
|
sources = [
|
|
|
|
"src/feature_support_util/feature_support_util.cpp",
|
|
|
|
"src/feature_support_util/feature_support_util.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs -= angle_undefine_configs
|
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
":extra_warnings",
|
|
|
|
]
|
|
|
|
|
|
|
|
public_configs = [ ":angle_feature_support_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",
|
|
|
|
]
|
|
|
|
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_gpu_info_util_sources
|
2017-02-08 18:43:47 +03:00
|
|
|
deps = []
|
|
|
|
libs = []
|
|
|
|
defines = []
|
|
|
|
|
2018-06-23 00:42:09 +03:00
|
|
|
if (is_android) {
|
|
|
|
sources += [ "src/gpu_info_util/SystemInfo_android.cpp" ]
|
|
|
|
}
|
|
|
|
|
2017-03-24 21:58:59 +03:00
|
|
|
if (is_win) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_win_sources
|
2017-03-24 21:58:59 +03:00
|
|
|
libs += [ "setupapi.lib" ]
|
|
|
|
defines += [ "GPU_INFO_USE_SETUPAPI" ]
|
|
|
|
}
|
|
|
|
|
2017-02-08 18:43:47 +03:00
|
|
|
if (is_linux) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_linux_sources
|
2017-02-08 18:43:47 +03:00
|
|
|
|
|
|
|
if (use_x11) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_x11_sources
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_libpci_sources
|
2017-02-08 18:43:47 +03:00
|
|
|
defines += [ "GPU_INFO_USE_LIBPCI" ]
|
|
|
|
libs += [ "pci" ]
|
|
|
|
}
|
2017-02-16 18:58:46 +03:00
|
|
|
|
|
|
|
if (is_mac) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_mac_sources
|
2017-02-16 18:58:46 +03:00
|
|
|
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") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = angle_translator_sources
|
2015-12-11 20:30:15 +03:00
|
|
|
defines = []
|
|
|
|
|
2017-10-10 02:14:06 +03:00
|
|
|
if (angle_enable_essl || use_fuzzing_engine) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += angle_translator_essl_sources
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += angle_translator_glsl_sources
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += angle_translator_hlsl_sources
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += angle_translator_lib_vulkan_sources
|
2017-01-14 01:29:51 +03:00
|
|
|
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
|
|
|
|
2018-08-07 10:25:42 +03:00
|
|
|
# commit id should depend on angle's HEAD revision
|
2018-08-21 07:04:05 +03:00
|
|
|
inputs = [
|
|
|
|
".git/HEAD",
|
|
|
|
]
|
2018-08-07 10:25:42 +03: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
|
|
|
|
2018-02-06 17:54:02 +03:00
|
|
|
if (angle_enable_vulkan) {
|
|
|
|
# Use this target to include everything ANGLE needs for Vulkan.
|
|
|
|
group("angle_vulkan") {
|
|
|
|
deps = [
|
2018-02-07 23:24:47 +03:00
|
|
|
"$angle_root/third_party/glslang:glslang",
|
2018-02-06 17:54:02 +03:00
|
|
|
]
|
|
|
|
public_deps = [
|
2018-05-24 19:56:17 +03:00
|
|
|
"$angle_root/third_party/vulkan-headers:vulkan_headers",
|
2018-02-06 17:54:02 +03:00
|
|
|
]
|
|
|
|
public_configs = [
|
2018-02-07 23:24:47 +03:00
|
|
|
"$angle_root/third_party/glslang:glslang_config",
|
2018-02-06 17:54:02 +03:00
|
|
|
"$angle_root/third_party/vulkan-validation-layers:vulkan_config",
|
|
|
|
]
|
2018-04-26 17:05:18 +03:00
|
|
|
data_deps = []
|
2018-02-06 17:54:02 +03:00
|
|
|
if (!is_android) {
|
2018-05-24 19:56:17 +03:00
|
|
|
deps += [ "$angle_root/third_party/vulkan-loader:libvulkan" ]
|
|
|
|
data_deps += [ "$angle_root/third_party/vulkan-tools:VkICD_mock_icd" ]
|
|
|
|
public_configs +=
|
|
|
|
[ "$angle_root/third_party/vulkan-loader:vulkan_loader_config" ]
|
2018-04-10 22:43:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (angle_enable_vulkan_validation_layers) {
|
2018-04-26 17:05:18 +03:00
|
|
|
data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_validation_layers" ]
|
2018-04-10 22:43:46 +03:00
|
|
|
if (!is_android) {
|
2018-04-26 17:05:18 +03:00
|
|
|
data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_gen_json_files" ]
|
2018-04-10 22:43:46 +03:00
|
|
|
}
|
2018-02-06 17:54:02 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
static_library("libANGLE") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_sources
|
2015-01-14 22:31:02 +03:00
|
|
|
|
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 = [
|
2018-08-30 02:04:15 +03:00
|
|
|
":angle_feature_support_util",
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_d3d_shared_sources
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_d3d9_sources
|
2015-01-14 22:31:02 +03:00
|
|
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_d3d11_sources
|
|
|
|
sources += libangle_d3d11_win32_sources
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gl_sources
|
2015-02-13 23:41:41 +03:00
|
|
|
include_dirs += [ "src/third_party/khronos" ]
|
|
|
|
|
2017-10-22 05:19:40 +03:00
|
|
|
if (angle_enable_gl_null) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gl_null_sources
|
2017-10-22 05:19:40 +03:00
|
|
|
}
|
2015-02-13 23:41:41 +03:00
|
|
|
if (is_win) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gl_wgl_sources
|
2015-02-13 23:41:41 +03:00
|
|
|
}
|
2015-05-26 18:32:58 +03:00
|
|
|
if (use_x11) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gl_glx_sources
|
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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gl_cgl_sources
|
2016-05-14 00:27:57 +03:00
|
|
|
libs += [
|
|
|
|
"Cocoa.framework",
|
|
|
|
"IOSurface.framework",
|
|
|
|
"OpenGL.framework",
|
|
|
|
"QuartzCore.framework",
|
|
|
|
]
|
|
|
|
}
|
2016-06-03 07:18:38 +03:00
|
|
|
if (is_android) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gl_egl_sources
|
|
|
|
sources += libangle_gl_egl_dl_sources
|
|
|
|
sources += libangle_gl_egl_android_sources
|
2018-05-19 01:48:50 +03:00
|
|
|
if (ndk_supports_nativewindow) {
|
|
|
|
libs += [ "nativewindow" ]
|
|
|
|
} else {
|
|
|
|
libs += [ "android" ]
|
|
|
|
}
|
|
|
|
libs += [ "log" ]
|
2016-06-03 07:18:38 +03:00
|
|
|
}
|
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" ]
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gl_egl_sources
|
|
|
|
sources += libangle_gl_egl_dl_sources
|
|
|
|
sources += libangle_gl_ozone_sources
|
2016-06-13 23:39:01 +03:00
|
|
|
}
|
2015-02-13 23:41:41 +03:00
|
|
|
}
|
|
|
|
|
2016-05-25 19:57:39 +03:00
|
|
|
if (angle_enable_vulkan) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_vulkan_sources
|
2016-11-24 05:05:36 +03:00
|
|
|
if (is_win) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_vulkan_win32_sources
|
2016-11-24 05:05:36 +03:00
|
|
|
}
|
|
|
|
if (is_linux) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_vulkan_xcb_sources
|
2016-11-24 05:05:36 +03:00
|
|
|
}
|
2018-01-20 03:04:05 +03:00
|
|
|
if (is_android) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_vulkan_android_sources
|
2018-01-20 03:04:05 +03:00
|
|
|
}
|
2018-02-06 17:54:02 +03:00
|
|
|
deps += [ ":angle_vulkan" ]
|
2018-05-24 19:56:17 +03:00
|
|
|
public_deps += [ "$angle_root/third_party/vulkan-headers:vulkan_headers" ]
|
2018-04-27 18:45:03 +03:00
|
|
|
|
|
|
|
# Include generated shaders.
|
|
|
|
import("src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.gni")
|
|
|
|
sources += angle_vulkan_internal_shaders
|
2016-05-25 19:57:39 +03:00
|
|
|
}
|
|
|
|
|
2016-09-23 22:56:30 +03:00
|
|
|
if (angle_enable_null) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_null_sources
|
2016-09-23 22:56:30 +03:00
|
|
|
}
|
|
|
|
|
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=",
|
2018-01-13 01:17:27 +03:00
|
|
|
"GL_API=",
|
2017-01-03 19:03:23 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-02-09 01:58:46 +03:00
|
|
|
shared_library("libGLESv2${angle_libs_suffix}") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libglesv2_sources
|
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" ]
|
2018-05-15 22:35:15 +03:00
|
|
|
configs += [ ":build_id_config" ]
|
2017-01-16 17:44:49 +03:00
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (is_win) {
|
2018-05-14 16:11:51 +03:00
|
|
|
ldflags = [ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2_autogen.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) {
|
2018-01-13 01:17:27 +03:00
|
|
|
defines += [
|
|
|
|
"GL_APICALL=",
|
|
|
|
"GL_API=",
|
|
|
|
]
|
2017-01-03 19:03:23 +03:00
|
|
|
} else {
|
2018-01-13 01:17:27 +03:00
|
|
|
defines += [
|
|
|
|
"GL_APICALL=__attribute__((visibility(\"default\")))",
|
|
|
|
"GL_API=__attribute__((visibility(\"default\")))",
|
|
|
|
]
|
2017-01-03 19:03:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":libANGLE",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("libGLESv2_static") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libglesv2_sources
|
2017-01-03 19:03:23 +03:00
|
|
|
|
|
|
|
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",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-02-09 01:58:46 +03:00
|
|
|
shared_library("libGLESv1_CM${angle_libs_suffix}") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libglesv1_cm_sources
|
2018-01-13 01:17:27 +03:00
|
|
|
|
|
|
|
if (is_android) {
|
|
|
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
2018-05-15 22:35:15 +03:00
|
|
|
configs += [ ":build_id_config" ]
|
2018-01-13 01:17:27 +03:00
|
|
|
}
|
2018-02-15 06:01:31 +03:00
|
|
|
|
|
|
|
if (is_mac && !is_component_build) {
|
|
|
|
ldflags = [
|
|
|
|
"-install_name",
|
|
|
|
"@rpath/${target_name}.dylib",
|
|
|
|
]
|
|
|
|
public_configs = [ ":shared_library_public_config" ]
|
|
|
|
}
|
|
|
|
|
2018-01-13 01:17:27 +03:00
|
|
|
configs -= angle_undefine_configs
|
|
|
|
configs += [
|
|
|
|
":commit_id_config",
|
|
|
|
":debug_annotations_config",
|
|
|
|
":extra_warnings",
|
|
|
|
":internal_config",
|
|
|
|
]
|
|
|
|
|
|
|
|
defines = []
|
|
|
|
if (is_win) {
|
|
|
|
defines += [
|
|
|
|
"GL_APICALL=",
|
|
|
|
"GL_API=",
|
|
|
|
]
|
|
|
|
} else {
|
|
|
|
defines += [
|
|
|
|
"GL_APICALL=__attribute__((visibility(\"default\")))",
|
|
|
|
"GL_API=__attribute__((visibility(\"default\")))",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
2018-02-09 01:58:46 +03:00
|
|
|
":libGLESv2${angle_libs_suffix}",
|
2018-01-13 01:17:27 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("libGLESv1_CM_static") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libglesv1_cm_sources
|
2018-01-13 01:17:27 +03:00
|
|
|
|
|
|
|
configs -= angle_undefine_configs
|
|
|
|
configs += [
|
|
|
|
":commit_id_config",
|
|
|
|
":debug_annotations_config",
|
|
|
|
":extra_warnings",
|
|
|
|
":internal_config",
|
|
|
|
]
|
|
|
|
|
|
|
|
public_configs = [ ":angle_static" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":libGLESv2_static",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-02-09 01:58:46 +03:00
|
|
|
shared_library("libEGL${angle_libs_suffix}") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libegl_sources
|
2015-01-14 22:31:02 +03:00
|
|
|
|
2017-01-16 17:44:49 +03:00
|
|
|
if (is_android) {
|
|
|
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
2018-05-15 22:35:15 +03:00
|
|
|
configs += [ ":build_id_config" ]
|
2017-01-16 17:44:49 +03:00
|
|
|
}
|
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",
|
2018-02-09 01:58:46 +03:00
|
|
|
":libGLESv2${angle_libs_suffix}",
|
2017-01-03 19:03:23 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("libEGL_static") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libegl_sources
|
2017-01-03 19:03:23 +03:00
|
|
|
|
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
|
|
|
|
2018-08-24 05:11:55 +03:00
|
|
|
import("util/util.gni")
|
2016-01-04 19:25:00 +03:00
|
|
|
|
|
|
|
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"
|
2018-02-09 01:58:46 +03:00
|
|
|
dep_suffix = "${angle_libs_suffix}"
|
2017-01-03 19:03:23 +03:00
|
|
|
} 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) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = util_sources
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_win) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += util_win32_sources
|
2017-01-03 19:03:23 +03:00
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2018-05-19 01:48:50 +03:00
|
|
|
libs = []
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_linux) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += util_linux_sources
|
2018-05-19 01:48:50 +03:00
|
|
|
libs += [
|
2017-01-03 19:03:23 +03:00
|
|
|
"rt",
|
|
|
|
"dl",
|
|
|
|
]
|
|
|
|
}
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (is_mac) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += util_osx_sources
|
2018-05-19 01:48:50 +03:00
|
|
|
libs += [
|
2017-01-03 19:03:23 +03:00
|
|
|
"AppKit.framework",
|
|
|
|
"QuartzCore.framework",
|
|
|
|
]
|
|
|
|
}
|
2016-06-03 07:18:38 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (use_x11) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += util_x11_sources
|
2017-01-03 19:03:23 +03:00
|
|
|
}
|
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([])
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += util_linux_sources
|
|
|
|
sources += util_android_sources
|
2018-06-21 00:05:32 +03:00
|
|
|
libs += [
|
|
|
|
"android",
|
|
|
|
"log",
|
|
|
|
]
|
2017-01-03 19:03:23 +03:00
|
|
|
}
|
2015-09-15 20:12:07 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
if (use_ozone) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += util_ozone_sources
|
2017-01-03 19:03:23 +03:00
|
|
|
}
|
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" ]
|
|
|
|
|
|
|
|
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",
|
2017-06-29 00:01:15 +03:00
|
|
|
]
|
|
|
|
}
|
2018-04-13 02:06:48 +03:00
|
|
|
|
|
|
|
if (is_android) {
|
|
|
|
# Package ANGLE libraries for pre-installed system image
|
|
|
|
android_apk("angle_apk") {
|
|
|
|
if (build_apk_secondary_abi && android_64bit_target_cpu) {
|
|
|
|
secondary_abi_shared_libraries = [
|
2018-04-26 17:05:18 +03:00
|
|
|
"//third_party/angle:libEGL${angle_libs_suffix}($android_secondary_abi_toolchain)",
|
2018-04-30 19:31:18 +03:00
|
|
|
"//third_party/angle:libGLESv1_CM${angle_libs_suffix}($android_secondary_abi_toolchain)",
|
2018-05-19 01:48:50 +03:00
|
|
|
"//third_party/angle:libGLESv2${angle_libs_suffix}($android_secondary_abi_toolchain)",
|
2018-04-13 02:06:48 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
android_manifest = "AndroidManifest.xml"
|
2018-04-26 17:05:18 +03:00
|
|
|
|
|
|
|
# requires_sdk_api_level_23 tells the apk tool that this apk is only
|
|
|
|
# supported on M or later releases (which is true for Vulkan).
|
|
|
|
# Allows tool to optimize for that.
|
2018-04-13 02:06:48 +03:00
|
|
|
requires_sdk_api_level_23 = true
|
2018-07-30 18:46:27 +03:00
|
|
|
apk_name = "ANGLEPrebuilt"
|
2018-04-13 02:06:48 +03:00
|
|
|
uncompress_shared_libraries = true
|
|
|
|
shared_libraries = [
|
2018-04-26 17:05:18 +03:00
|
|
|
"//third_party/angle:libEGL${angle_libs_suffix}",
|
2018-04-30 19:31:18 +03:00
|
|
|
"//third_party/angle:libGLESv1_CM${angle_libs_suffix}",
|
2018-05-19 01:48:50 +03:00
|
|
|
"//third_party/angle:libGLESv2${angle_libs_suffix}",
|
2018-04-13 02:06:48 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|