1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # Only needed on Windows.
7 gles_gypi = exec_script(
8 "//build/gypi_to_gn.py",
9 [ rebase_path("src/libGLESv2.gypi") ],
11 [ "src/libGLESv2.gypi" ])
13 egl_gypi = exec_script(
14 "//build/gypi_to_gn.py",
15 [ rebase_path("src/libEGL.gypi") ],
17 [ "src/libEGL.gypi" ])
20 compiler_gypi = exec_script(
21 "//build/gypi_to_gn.py",
22 [ rebase_path("src/compiler.gypi") ],
24 [ "src/compiler.gypi" ])
26 # This config is exported to dependent targets (and also applied to internal
28 config("external_config") {
34 # This config is applied to internal Angle targets (not pushed to dependents).
35 config("internal_config") {
42 component("translator") {
44 "src/compiler/translator/ShaderLang.cpp",
45 "src/compiler/translator/ShaderVars.cpp",
48 defines = [ "ANGLE_TRANSLATOR_IMPLEMENTATION" ]
50 configs -= [ "//build/config/compiler:chromium_code" ]
53 "//build/config/compiler:no_chromium_code",
59 forward_dependent_configs_from = [ ":translator_lib" ]
62 # Holds the shared includes so we only need to list them once.
63 source_set("includes") {
66 "include/EGL/eglext.h",
67 "include/EGL/eglplatform.h",
68 "include/GLES2/gl2.h",
69 "include/GLES2/gl2ext.h",
70 "include/GLES2/gl2platform.h",
71 "include/GLES3/gl3.h",
72 "include/GLES3/gl3ext.h",
73 "include/GLES3/gl3platform.h",
74 "include/GLSLANG/ShaderLang.h",
75 "include/KHR/khrplatform.h",
79 static_library("preprocessor") {
80 sources = rebase_path(compiler_gypi.angle_preprocessor_sources, ".", "src")
82 configs -= [ "//build/config/compiler:chromium_code" ]
85 "//build/config/compiler:no_chromium_code",
89 config("translator_static_config") {
90 defines = [ "ANGLE_TRANSLATOR_STATIC" ]
93 static_library("translator_lib") {
94 sources = rebase_path(compiler_gypi.angle_translator_lib_sources, ".", "src")
96 configs -= [ "//build/config/compiler:chromium_code" ]
99 ":translator_static_config",
100 "//build/config/compiler:no_chromium_code",
102 direct_dependent_configs = [ ":external_config" ]
110 static_library("translator_static") {
112 "src/compiler/translator/ShaderLang.cpp",
113 "src/compiler/translator/ShaderVars.cpp",
116 configs -= [ "//build/config/compiler:chromium_code" ]
119 "//build/config/compiler:no_chromium_code",
121 direct_dependent_configs = [ ":translator_static_config" ]
126 forward_dependent_configs_from = [ ":translator_lib" ]
129 config("commit_id_config") {
130 include_dirs = [ "$root_gen_dir/angle" ]
133 action("commit_id") {
134 script = "src/commit_id.py"
136 output_file = "$root_gen_dir/angle/id/commit.h"
137 outputs = [ output_file ]
141 rebase_path(".", root_build_dir),
142 rebase_path(output_file, root_build_dir),
145 direct_dependent_configs = [ ":commit_id_config" ]
149 angle_enable_d3d9 = true
150 angle_enable_d3d11 = true
152 shared_library("libGLESv2") {
153 sources = rebase_path(gles_gypi.angle_libglesv2_sources, ".", "src")
156 "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " +
157 "\"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }",
159 "GL_GLEXT_PROTOTYPES=",
164 # Shared D3dD sources.
165 if (angle_enable_d3d9 || angle_enable_d3d11) {
166 sources += rebase_path(gles_gypi.angle_d3d_shared_sources, ".", "src")
169 if (angle_enable_d3d9) {
170 sources += rebase_path(gles_gypi.angle_d3d9_sources, ".", "src")
171 defines += [ "ANGLE_ENABLE_D3D9" ]
172 libs += [ "d3d9.lib" ]
175 if (angle_enable_d3d11) {
176 sources += rebase_path(gles_gypi.angle_d3d11_sources, ".", "src")
177 defines += [ "ANGLE_ENABLE_D3D11" ]
178 libs += [ "dxguid.lib" ]
182 defines += [ "ANGLE_ENABLE_PERF" ]
183 libs += [ "d3d9.lib" ]
186 configs -= [ "//build/config/compiler:chromium_code" ]
189 "//build/config/compiler:no_chromium_code",
192 include_dirs = [ "src/libGLESv2" ]
198 #":copy_compiler_dll", TODO(GYP)
202 shared_library("libEGL") {
203 sources = rebase_path(egl_gypi.angle_libegl_sources, ".", "src")
207 "GL_GLEXT_PROTOTYPES=",
211 configs -= [ "//build/config/compiler:chromium_code" ]
214 "//build/config/compiler:no_chromium_code",
218 defines += [ "ANGLE_ENABLE_PERF" ]
221 include_dirs = [ "src/libGLESv2" ]
222 libs = [ "d3d9.lib" ]