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