2014-06-23 23:13:02 +04:00
|
|
|
# Copyright 2014 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2014-07-17 01:19:18 +04:00
|
|
|
if (is_win) {
|
|
|
|
# Only needed on Windows.
|
|
|
|
gles_gypi = exec_script(
|
|
|
|
"//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("src/libGLESv2.gypi") ],
|
|
|
|
"scope",
|
|
|
|
[ "src/libGLESv2.gypi" ])
|
|
|
|
|
|
|
|
egl_gypi = exec_script(
|
|
|
|
"//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("src/libEGL.gypi") ],
|
|
|
|
"scope",
|
|
|
|
[ "src/libEGL.gypi" ])
|
|
|
|
}
|
|
|
|
|
|
|
|
compiler_gypi = exec_script(
|
|
|
|
"//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("src/compiler.gypi") ],
|
|
|
|
"scope",
|
|
|
|
[ "src/compiler.gypi" ])
|
|
|
|
|
2014-07-23 04:00:17 +04:00
|
|
|
# This config is exported to dependent targets (and also applied to internal
|
|
|
|
# ones).
|
|
|
|
config("external_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
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",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
component("translator") {
|
|
|
|
sources = [
|
|
|
|
"src/compiler/translator/ShaderLang.cpp",
|
|
|
|
]
|
|
|
|
|
|
|
|
defines = [ "ANGLE_TRANSLATOR_IMPLEMENTATION" ]
|
|
|
|
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
"//build/config/compiler:no_chromium_code",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":translator_lib",
|
|
|
|
]
|
2014-07-23 04:00:17 +04:00
|
|
|
forward_dependent_configs_from = [ ":translator_lib" ]
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Holds the shared includes so we only need to list them once.
|
|
|
|
source_set("includes") {
|
|
|
|
sources = [
|
|
|
|
"include/EGL/egl.h",
|
|
|
|
"include/EGL/eglext.h",
|
|
|
|
"include/EGL/eglplatform.h",
|
|
|
|
"include/GLES2/gl2.h",
|
|
|
|
"include/GLES2/gl2ext.h",
|
|
|
|
"include/GLES2/gl2platform.h",
|
|
|
|
"include/GLES3/gl3.h",
|
|
|
|
"include/GLES3/gl3ext.h",
|
|
|
|
"include/GLES3/gl3platform.h",
|
|
|
|
"include/GLSLANG/ShaderLang.h",
|
|
|
|
"include/KHR/khrplatform.h",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
"//build/config/compiler:no_chromium_code",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2014-07-17 22:16:32 +04:00
|
|
|
#TODO(jmadill): define static for this config only
|
2014-06-23 23:13:02 +04:00
|
|
|
static_library("translator_lib") {
|
2014-07-17 01:19:18 +04:00
|
|
|
sources = rebase_path(compiler_gypi.angle_translator_lib_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
"//build/config/compiler:no_chromium_code",
|
|
|
|
]
|
2014-07-23 04:00:17 +04:00
|
|
|
direct_dependent_configs = [ ":external_config" ]
|
2014-06-23 23:13:02 +04:00
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":preprocessor",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
config("translator_static_config") {
|
|
|
|
defines = [ "ANGLE_TRANSLATOR_STATIC" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("translator_static") {
|
|
|
|
sources = [
|
|
|
|
"src/compiler/translator/ShaderLang.cpp",
|
2014-07-17 22:16:32 +04:00
|
|
|
"src/compiler/translator/ShaderVars.cpp",
|
2014-06-23 23:13:02 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
"//build/config/compiler:no_chromium_code",
|
|
|
|
]
|
|
|
|
direct_dependent_configs = [ ":translator_static_config" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":translator_lib",
|
|
|
|
]
|
2014-07-23 04:00:17 +04:00
|
|
|
forward_dependent_configs_from = [ ":translator_lib" ]
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
config("commit_id_config") {
|
|
|
|
include_dirs = [ "$root_gen_dir/angle" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
action("commit_id") {
|
|
|
|
script = "src/commit_id.py"
|
|
|
|
|
|
|
|
output_file = "$root_gen_dir/angle/id/commit.h"
|
|
|
|
outputs = [ output_file ]
|
|
|
|
|
|
|
|
args = [
|
|
|
|
"gen",
|
|
|
|
rebase_path(".", root_build_dir),
|
|
|
|
rebase_path(output_file, root_build_dir),
|
|
|
|
]
|
|
|
|
|
|
|
|
direct_dependent_configs = [ ":commit_id_config" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
angle_enable_d3d9 = true
|
|
|
|
angle_enable_d3d11 = true
|
|
|
|
|
|
|
|
shared_library("libGLESv2") {
|
2014-07-17 01:19:18 +04:00
|
|
|
sources = rebase_path(gles_gypi.angle_libglesv2_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
|
|
|
|
defines = [
|
|
|
|
"ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " +
|
2014-08-01 01:34:30 +04:00
|
|
|
"\"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }",
|
2014-06-23 23:13:02 +04:00
|
|
|
"GL_APICALL=",
|
|
|
|
"GL_GLEXT_PROTOTYPES=",
|
|
|
|
"EGLAPI=",
|
|
|
|
]
|
|
|
|
libs = []
|
|
|
|
|
|
|
|
# Shared D3dD sources.
|
|
|
|
if (angle_enable_d3d9 || angle_enable_d3d11) {
|
2014-07-17 01:19:18 +04:00
|
|
|
sources += rebase_path(gles_gypi.angle_d3d_shared_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (angle_enable_d3d9) {
|
2014-07-17 01:19:18 +04:00
|
|
|
sources += rebase_path(gles_gypi.angle_d3d9_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
defines += [ "ANGLE_ENABLE_D3D9" ]
|
|
|
|
libs += [ "d3d9.lib" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (angle_enable_d3d11) {
|
2014-07-17 01:19:18 +04:00
|
|
|
sources += rebase_path(gles_gypi.angle_d3d11_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
defines += [ "ANGLE_ENABLE_D3D11" ]
|
|
|
|
libs += [ "dxguid.lib" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_debug) {
|
|
|
|
defines += [ "ANGLE_ENABLE_PERF" ]
|
|
|
|
libs += [ "d3d9.lib" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
"//build/config/compiler:no_chromium_code",
|
|
|
|
]
|
|
|
|
|
|
|
|
include_dirs = [ "src/libGLESv2" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":commit_id",
|
|
|
|
":includes",
|
|
|
|
":translator",
|
|
|
|
#":copy_compiler_dll", TODO(GYP)
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
shared_library("libEGL") {
|
2014-07-17 01:19:18 +04:00
|
|
|
sources = rebase_path(egl_gypi.angle_libegl_sources, ".", "src")
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2014-08-01 18:04:09 +04:00
|
|
|
defines = [
|
|
|
|
"GL_APICALL=",
|
|
|
|
"GL_GLEXT_PROTOTYPES=",
|
|
|
|
"EGLAPI=",
|
|
|
|
]
|
|
|
|
|
2014-06-23 23:13:02 +04:00
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [
|
|
|
|
":internal_config",
|
|
|
|
"//build/config/compiler:no_chromium_code",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (is_debug) {
|
2014-08-01 18:04:09 +04:00
|
|
|
defines += [ "ANGLE_ENABLE_PERF" ]
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
include_dirs = [ "src/libGLESv2" ]
|
|
|
|
libs = [ "d3d9.lib" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":commit_id",
|
|
|
|
":includes",
|
|
|
|
":libGLESv2",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
} # is_win
|