Corentin Wallez | d4bcfa2 | 2015-09-01 10:32:30 -0400 | [diff] [blame] | 1 | # Copyright 2014-2015 The Chromium Authors. All rights reserved. |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 5 | # import the use_x11 variable |
| 6 | import("//build/config/ui.gni") |
Corentin Wallez | d4bcfa2 | 2015-09-01 10:32:30 -0400 | [diff] [blame] | 7 | import("//third_party/angle/build/angle_common.gni") |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 8 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 9 | angle_git_is_present = exec_script("src/commit_id.py", |
| 10 | [ |
| 11 | "check", |
| 12 | rebase_path(".", root_build_dir), |
| 13 | ], |
| 14 | "value") |
| 15 | |
| 16 | angle_use_commit_id = angle_git_is_present == 1 |
| 17 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 18 | gles_gypi = exec_script( |
| 19 | "//build/gypi_to_gn.py", |
| 20 | [ rebase_path("src/libGLESv2.gypi") ], |
| 21 | "scope", |
| 22 | [ "src/libGLESv2.gypi" ]) |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 23 | |
| 24 | compiler_gypi = exec_script( |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 25 | "//build/gypi_to_gn.py", |
| 26 | [ rebase_path("src/compiler.gypi") ], |
| 27 | "scope", |
| 28 | [ "src/compiler.gypi" ]) |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 29 | |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 30 | # This config is exported to dependent targets (and also applied to internal |
| 31 | # ones). |
| 32 | config("external_config") { |
| 33 | include_dirs = [ |
| 34 | "include", |
| 35 | ] |
| 36 | } |
| 37 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 38 | # This config is applied to internal Angle targets (not pushed to dependents). |
| 39 | config("internal_config") { |
| 40 | include_dirs = [ |
| 41 | "include", |
| 42 | "src", |
| 43 | ] |
| 44 | } |
| 45 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 46 | if (is_win) { |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 47 | copy("copy_compiler_dll") { |
Dirk Pranke | a17e77f | 2015-03-18 14:58:49 -0700 | [diff] [blame] | 48 | sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 49 | outputs = [ "$root_build_dir/d3dcompiler_47.dll" ] |
| 50 | } |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 51 | } |
| 52 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 53 | component("translator") { |
| 54 | sources = [ |
| 55 | "src/compiler/translator/ShaderLang.cpp", |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 56 | "src/compiler/translator/ShaderVars.cpp", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 57 | ] |
| 58 | |
| 59 | defines = [ "ANGLE_TRANSLATOR_IMPLEMENTATION" ] |
| 60 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 61 | if (angle_enable_hlsl) { |
| 62 | sources += rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src") |
| 63 | defines += [ "ANGLE_ENABLE_HLSL" ] |
| 64 | } |
| 65 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 66 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 67 | configs += [ |
| 68 | ":internal_config", |
| 69 | "//build/config/compiler:no_chromium_code", |
| 70 | ] |
| 71 | |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 72 | public_deps = [ |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 73 | ":translator_lib", |
| 74 | ] |
| 75 | } |
| 76 | |
| 77 | # Holds the shared includes so we only need to list them once. |
| 78 | source_set("includes") { |
| 79 | sources = [ |
| 80 | "include/EGL/egl.h", |
| 81 | "include/EGL/eglext.h", |
| 82 | "include/EGL/eglplatform.h", |
| 83 | "include/GLES2/gl2.h", |
| 84 | "include/GLES2/gl2ext.h", |
| 85 | "include/GLES2/gl2platform.h", |
| 86 | "include/GLES3/gl3.h", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 87 | "include/GLES3/gl3platform.h", |
Geoff Lang | ee48376 | 2015-09-15 13:12:07 -0400 | [diff] [blame] | 88 | "include/GLES3/gl31.h", |
| 89 | "include/GLES3/gl32.h", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 90 | "include/GLSLANG/ShaderLang.h", |
| 91 | "include/KHR/khrplatform.h", |
| 92 | ] |
| 93 | } |
| 94 | |
| 95 | static_library("preprocessor") { |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 96 | sources = rebase_path(compiler_gypi.angle_preprocessor_sources, ".", "src") |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 97 | |
| 98 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 99 | configs += [ |
| 100 | ":internal_config", |
| 101 | "//build/config/compiler:no_chromium_code", |
| 102 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 103 | } |
| 104 | |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 105 | config("translator_static_config") { |
| 106 | defines = [ "ANGLE_TRANSLATOR_STATIC" ] |
| 107 | } |
| 108 | |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 109 | |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 110 | config("debug_annotations_config") { |
| 111 | if (is_debug) { |
| 112 | defines = [ |
| 113 | "ANGLE_ENABLE_DEBUG_ANNOTATIONS", |
| 114 | ] |
| 115 | } |
| 116 | } |
| 117 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 118 | static_library("angle_common") { |
| 119 | sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src") |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 120 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 121 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 122 | configs += [ |
| 123 | ":internal_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 124 | ":debug_annotations_config", |
Nico Weber | 47b53c0 | 2015-06-04 12:58:22 -0700 | [diff] [blame] | 125 | "//build/config/compiler:no_chromium_code", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 126 | ] |
| 127 | } |
| 128 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 129 | static_library("translator_lib") { |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 130 | sources = rebase_path(compiler_gypi.angle_translator_lib_sources, ".", "src") |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 131 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 132 | if (angle_enable_hlsl) { |
| 133 | sources += rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src") |
| 134 | defines = [ "ANGLE_ENABLE_HLSL" ] |
| 135 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 136 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 137 | configs += [ |
| 138 | ":internal_config", |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 139 | ":translator_static_config", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 140 | "//build/config/compiler:no_chromium_code", |
| 141 | ] |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 142 | public_configs = [ ":external_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 143 | |
| 144 | deps = [ |
| 145 | ":includes", |
| 146 | ":preprocessor", |
| 147 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 148 | |
| 149 | public_deps = [ |
| 150 | ":angle_common", |
| 151 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 152 | } |
| 153 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 154 | static_library("translator_static") { |
| 155 | sources = [ |
| 156 | "src/compiler/translator/ShaderLang.cpp", |
Jamie Madill | a2ad4e8 | 2014-07-17 14:16:32 -0400 | [diff] [blame] | 157 | "src/compiler/translator/ShaderVars.cpp", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 158 | ] |
| 159 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 160 | if (angle_enable_hlsl) { |
| 161 | defines = [ "ANGLE_ENABLE_HLSL" ] |
| 162 | } |
| 163 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 164 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 165 | configs += [ |
| 166 | ":internal_config", |
| 167 | "//build/config/compiler:no_chromium_code", |
| 168 | ] |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 169 | public_configs = [ ":translator_static_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 170 | |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 171 | public_deps = [ |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 172 | ":translator_lib", |
| 173 | ] |
| 174 | } |
| 175 | |
| 176 | config("commit_id_config") { |
| 177 | include_dirs = [ "$root_gen_dir/angle" ] |
| 178 | } |
| 179 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 180 | commit_id_output_file = "$root_gen_dir/angle/id/commit.h" |
| 181 | if (angle_use_commit_id) { |
| 182 | action("commit_id") { |
| 183 | script = "src/commit_id.py" |
| 184 | outputs = [ |
| 185 | commit_id_output_file, |
| 186 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 187 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 188 | args = [ |
| 189 | "gen", |
| 190 | rebase_path(".", root_build_dir), |
| 191 | rebase_path(commit_id_output_file, root_build_dir), |
| 192 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 193 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 194 | public_configs = [ ":commit_id_config" ] |
| 195 | } |
| 196 | } else { |
| 197 | copy("commit_id") { |
| 198 | sources = [ |
| 199 | "src/commit.h", |
| 200 | ] |
| 201 | outputs = [ |
| 202 | commit_id_output_file, |
| 203 | ] |
| 204 | public_configs = [ ":commit_id_config" ] |
| 205 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 206 | } |
| 207 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 208 | config("libANGLE_config") { |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 209 | cflags = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 210 | defines = [] |
| 211 | if (angle_enable_d3d9) { |
| 212 | defines += [ "ANGLE_ENABLE_D3D9" ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 213 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 214 | if (angle_enable_d3d11) { |
| 215 | defines += [ "ANGLE_ENABLE_D3D11" ] |
| 216 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 217 | if (angle_enable_gl) { |
| 218 | defines += [ "ANGLE_ENABLE_OPENGL" ] |
| 219 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 220 | if (use_x11) { |
| 221 | defines += [ "ANGLE_USE_X11" ] |
| 222 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 223 | defines += [ |
Geoff Lang | ee48376 | 2015-09-15 13:12:07 -0400 | [diff] [blame] | 224 | "GL_GLEXT_PROTOTYPES", |
Austin Kinross | 502f3df | 2015-12-02 12:33:18 -0800 | [diff] [blame^] | 225 | "EGL_EGLEXT_PROTOTYPES", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 226 | ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 227 | |
| 228 | if (is_win) { |
| 229 | defines += [ |
| 230 | "GL_APICALL=", |
| 231 | "EGLAPI=", |
| 232 | ] |
| 233 | } else { |
| 234 | defines += [ |
| 235 | "GL_APICALL=__attribute__((visibility(\"default\")))", |
| 236 | "EGLAPI=__attribute__((visibility(\"default\")))", |
| 237 | ] |
| 238 | } |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 239 | if (is_win) { |
| 240 | cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled. |
| 241 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 242 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 243 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 244 | static_library("libANGLE") { |
| 245 | sources = rebase_path(gles_gypi.libangle_sources, ".", "src") |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 246 | |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 247 | include_dirs = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 248 | libs = [] |
| 249 | defines = [ |
| 250 | "LIBANGLE_IMPLEMENTATION", |
| 251 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 252 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 253 | # Shared D3D sources. |
| 254 | if (angle_enable_d3d9 || angle_enable_d3d11) { |
| 255 | sources += rebase_path(gles_gypi.libangle_d3d_shared_sources, ".", "src") |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 256 | |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 257 | defines += [ |
| 258 | "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + |
| 259 | "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }", |
| 260 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 261 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 262 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 263 | if (angle_enable_d3d9) { |
| 264 | sources += rebase_path(gles_gypi.libangle_d3d9_sources, ".", "src") |
| 265 | libs += [ "d3d9.lib" ] |
| 266 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 267 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 268 | if (angle_enable_d3d11) { |
| 269 | sources += rebase_path(gles_gypi.libangle_d3d11_sources, ".", "src") |
| 270 | sources += rebase_path(gles_gypi.libangle_d3d11_win32_sources, ".", "src") |
| 271 | libs += [ "dxguid.lib" ] |
| 272 | } |
| 273 | |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 274 | if (angle_enable_gl) { |
| 275 | sources += rebase_path(gles_gypi.libangle_gl_sources, ".", "src") |
| 276 | include_dirs += [ "src/third_party/khronos" ] |
| 277 | |
| 278 | if (is_win) { |
| 279 | sources += rebase_path(gles_gypi.libangle_gl_wgl_sources, ".", "src") |
| 280 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 281 | if (use_x11) { |
Corentin Wallez | 47fc1fe | 2015-05-14 10:54:18 -0400 | [diff] [blame] | 282 | sources += rebase_path(gles_gypi.libangle_gl_glx_sources, ".", "src") |
| 283 | libs += [ "X11" ] |
| 284 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 285 | } |
| 286 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 287 | if (is_debug) { |
| 288 | defines += [ |
| 289 | "ANGLE_GENERATE_SHADER_DEBUG_INFO", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 290 | ] |
| 291 | } |
| 292 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 293 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 294 | configs += [ |
| 295 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 296 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 297 | ":libANGLE_config", |
| 298 | ":internal_config", |
| 299 | "//build/config/compiler:no_chromium_code", |
| 300 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 301 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 302 | deps = [ |
| 303 | ":commit_id", |
| 304 | ":includes", |
Brett Wilson | a662abb | 2015-04-07 12:55:30 -0700 | [diff] [blame] | 305 | ":translator_static", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 306 | ":angle_common", |
| 307 | ] |
| 308 | |
| 309 | if (is_win) { |
| 310 | deps += [ ":copy_compiler_dll" ] |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | shared_library("libGLESv2") { |
| 315 | sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src") |
| 316 | |
| 317 | if (is_win) { |
John Abd-El-Malek | 330f0ad | 2014-11-05 13:14:01 -0800 | [diff] [blame] | 318 | ldflags = [ "/DEF:" + |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 319 | rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 320 | } |
John Abd-El-Malek | 657cd68 | 2014-11-05 14:04:19 -0800 | [diff] [blame] | 321 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 322 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 323 | configs += [ |
| 324 | ":internal_config", |
| 325 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 326 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 327 | ":libANGLE_config", |
| 328 | "//build/config/compiler:no_chromium_code", |
| 329 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 330 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 331 | defines = [ |
| 332 | "LIBGLESV2_IMPLEMENTATION", |
| 333 | ] |
| 334 | |
| 335 | deps = [ |
| 336 | ":includes", |
| 337 | ":libANGLE", |
| 338 | ] |
| 339 | } |
| 340 | |
| 341 | shared_library("libEGL") { |
| 342 | sources = rebase_path(gles_gypi.libegl_sources, ".", "src") |
| 343 | |
| 344 | if (is_win) { |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 345 | ldflags = [ "/DEF:" + |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 346 | rebase_path("src/libEGL/libEGL.def", root_build_dir) ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 347 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 348 | |
| 349 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 350 | configs += [ |
| 351 | ":internal_config", |
| 352 | ":commit_id_config", |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 353 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 354 | ":libANGLE_config", |
| 355 | "//build/config/compiler:no_chromium_code", |
| 356 | ] |
| 357 | |
| 358 | defines = [ |
| 359 | "LIBEGL_IMPLEMENTATION", |
| 360 | ] |
| 361 | |
| 362 | deps = [ |
| 363 | ":includes", |
| 364 | ":libGLESv2", |
| 365 | ] |
| 366 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 367 | |
| 368 | util_gypi = exec_script( |
| 369 | "//build/gypi_to_gn.py", |
| 370 | [ rebase_path("util/util.gyp") ], |
| 371 | "scope", |
| 372 | [ "util/util.gyp" ]) |
| 373 | |
| 374 | static_library("angle_util") { |
| 375 | sources = rebase_path(util_gypi.util_sources, ".", "util") |
| 376 | |
| 377 | if (is_win) { |
| 378 | sources += rebase_path(util_gypi.util_win32_sources, ".", "util") |
| 379 | } |
| 380 | |
| 381 | if (is_linux) { |
| 382 | sources += rebase_path(util_gypi.util_linux_sources, ".", "util") |
Dirk Pranke | ac0f9b1 | 2015-11-12 14:54:10 -0800 | [diff] [blame] | 383 | libs = [ "rt" ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 384 | } |
| 385 | |
| 386 | if (is_mac) { |
| 387 | sources += rebase_path(util_gypi.util_osx_sources, ".", "util") |
| 388 | } |
| 389 | |
| 390 | if (use_x11) { |
| 391 | sources += rebase_path(util_gypi.util_x11_sources, ".", "util") |
| 392 | } |
| 393 | |
Geoff Lang | ee48376 | 2015-09-15 13:12:07 -0400 | [diff] [blame] | 394 | defines = [ |
| 395 | "GL_GLEXT_PROTOTYPES", |
| 396 | "EGL_EGLEXT_PROTOTYPES", |
| 397 | ] |
| 398 | |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 399 | configs += [ |
| 400 | ":internal_config", |
| 401 | ":debug_annotations_config", |
| 402 | ] |
| 403 | |
| 404 | include_dirs = [ |
| 405 | "util", |
| 406 | ] |
| 407 | |
| 408 | deps = [ |
| 409 | ":libEGL", |
| 410 | ":libGLESv2", |
| 411 | ] |
| 412 | } |