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 |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 6 | import("//build/config/dcheck_always_on.gni") |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 7 | import("//build/config/linux/pkg_config.gni") |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 8 | import("//build/config/ui.gni") |
Corentin Wallez | d4bcfa2 | 2015-09-01 10:32:30 -0400 | [diff] [blame] | 9 | import("//third_party/angle/build/angle_common.gni") |
Frank Henigman | e8d5c5c | 2016-07-07 13:17:47 -0400 | [diff] [blame] | 10 | import("//ui/ozone/ozone.gni") |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 11 | |
Frank Henigman | e8d5c5c | 2016-07-07 13:17:47 -0400 | [diff] [blame] | 12 | if (ozone_platform_gbm) { |
Frank Henigman | 62ba962 | 2016-06-27 17:08:28 -0400 | [diff] [blame] | 13 | pkg_config("libdrm") { |
| 14 | packages = [ "libdrm" ] |
| 15 | } |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 16 | } |
| 17 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 18 | angle_git_is_present = exec_script("src/commit_id.py", |
| 19 | [ |
| 20 | "check", |
| 21 | rebase_path(".", root_build_dir), |
| 22 | ], |
| 23 | "value") |
| 24 | |
| 25 | angle_use_commit_id = angle_git_is_present == 1 |
| 26 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 27 | gles_gypi = exec_script("//build/gypi_to_gn.py", |
| 28 | [ rebase_path("src/libGLESv2.gypi") ], |
| 29 | "scope", |
| 30 | [ "src/libGLESv2.gypi" ]) |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 31 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 32 | compiler_gypi = exec_script("//build/gypi_to_gn.py", |
| 33 | [ rebase_path("src/compiler.gypi") ], |
| 34 | "scope", |
| 35 | [ "src/compiler.gypi" ]) |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 36 | |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 37 | # This config is exported to dependent targets (and also applied to internal |
| 38 | # ones). |
| 39 | config("external_config") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 40 | include_dirs = [ "include" ] |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 41 | } |
| 42 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 43 | # This config is applied to internal Angle targets (not pushed to dependents). |
| 44 | config("internal_config") { |
| 45 | include_dirs = [ |
| 46 | "include", |
| 47 | "src", |
| 48 | ] |
| 49 | } |
| 50 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 51 | if (is_win) { |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 52 | copy("copy_compiler_dll") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 53 | sources = [ |
| 54 | "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll", |
| 55 | ] |
| 56 | outputs = [ |
| 57 | "$root_out_dir/d3dcompiler_47.dll", |
| 58 | ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 59 | } |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 60 | } |
| 61 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 62 | angle_undefine_configs = [ |
| 63 | "//build/config/compiler:chromium_code", |
| 64 | "//build/config/compiler:default_include_dirs", |
| 65 | ] |
| 66 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 67 | component("translator") { |
| 68 | sources = [ |
| 69 | "src/compiler/translator/ShaderLang.cpp", |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 70 | "src/compiler/translator/ShaderVars.cpp", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 71 | ] |
| 72 | |
| 73 | defines = [ "ANGLE_TRANSLATOR_IMPLEMENTATION" ] |
| 74 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 75 | configs -= angle_undefine_configs |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 76 | configs += [ |
| 77 | ":internal_config", |
| 78 | "//build/config/compiler:no_chromium_code", |
| 79 | ] |
| 80 | |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 81 | public_deps = [ |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 82 | ":translator_lib", |
| 83 | ] |
| 84 | } |
| 85 | |
| 86 | # Holds the shared includes so we only need to list them once. |
| 87 | source_set("includes") { |
| 88 | sources = [ |
| 89 | "include/EGL/egl.h", |
| 90 | "include/EGL/eglext.h", |
| 91 | "include/EGL/eglplatform.h", |
| 92 | "include/GLES2/gl2.h", |
| 93 | "include/GLES2/gl2ext.h", |
| 94 | "include/GLES2/gl2platform.h", |
| 95 | "include/GLES3/gl3.h", |
Geoff Lang | ee48376 | 2015-09-15 13:12:07 -0400 | [diff] [blame] | 96 | "include/GLES3/gl31.h", |
| 97 | "include/GLES3/gl32.h", |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 98 | "include/GLES3/gl3platform.h", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 99 | "include/GLSLANG/ShaderLang.h", |
| 100 | "include/KHR/khrplatform.h", |
| 101 | ] |
| 102 | } |
| 103 | |
| 104 | static_library("preprocessor") { |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 105 | sources = rebase_path(compiler_gypi.angle_preprocessor_sources, ".", "src") |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 106 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 107 | configs -= angle_undefine_configs |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 108 | configs += [ |
| 109 | ":internal_config", |
| 110 | "//build/config/compiler:no_chromium_code", |
| 111 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 112 | } |
| 113 | |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 114 | config("translator_static_config") { |
| 115 | defines = [ "ANGLE_TRANSLATOR_STATIC" ] |
| 116 | } |
| 117 | |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 118 | config("debug_annotations_config") { |
| 119 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 120 | defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ] |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 121 | } |
| 122 | } |
| 123 | |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 124 | config("angle_release_asserts_config") { |
| 125 | if (dcheck_always_on) { |
| 126 | defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ] |
| 127 | } |
| 128 | } |
| 129 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 130 | config("angle_common_config") { |
| 131 | include_dirs = [ "src/common/third_party/numerics" ] |
| 132 | } |
| 133 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 134 | static_library("angle_common") { |
| 135 | sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src") |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 136 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 137 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 138 | configs += [ |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 139 | ":angle_common_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 140 | ":debug_annotations_config", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 141 | ":internal_config", |
Nico Weber | 47b53c0 | 2015-06-04 12:58:22 -0700 | [diff] [blame] | 142 | "//build/config/compiler:no_chromium_code", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 143 | ] |
Jeremy Roman | 06feb81 | 2016-04-06 16:39:52 -0400 | [diff] [blame] | 144 | |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 145 | public_deps = [ |
| 146 | ":commit_id", |
| 147 | ] |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 148 | public_configs = [ |
| 149 | ":angle_release_asserts_config", |
| 150 | ":angle_common_config", |
| 151 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 152 | } |
| 153 | |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 154 | config("angle_image_util_config") { |
| 155 | include_dirs = [ |
| 156 | "include", |
| 157 | "src", |
| 158 | ] |
| 159 | } |
| 160 | |
Dirk Pranke | 313d944 | 2016-07-13 18:01:55 -0700 | [diff] [blame^] | 161 | static_library("angle_image_util") { |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 162 | sources = rebase_path(gles_gypi.libangle_image_util_sources, ".", "src") |
| 163 | |
| 164 | configs -= angle_undefine_configs |
| 165 | configs += [ |
| 166 | ":internal_config", |
| 167 | "//build/config/compiler:no_chromium_code", |
| 168 | ] |
| 169 | |
| 170 | public_configs = [ ":angle_image_util_config" ] |
| 171 | |
| 172 | public_deps = [ |
| 173 | ":angle_common", |
| 174 | ] |
| 175 | } |
| 176 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 177 | static_library("translator_lib") { |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 178 | sources = rebase_path(compiler_gypi.angle_translator_lib_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 179 | defines = [] |
| 180 | |
| 181 | if (angle_enable_essl) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 182 | sources += |
| 183 | rebase_path(compiler_gypi.angle_translator_lib_essl_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 184 | defines += [ "ANGLE_ENABLE_ESSL" ] |
| 185 | } |
| 186 | |
| 187 | if (angle_enable_glsl) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 188 | sources += |
| 189 | rebase_path(compiler_gypi.angle_translator_lib_glsl_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 190 | defines += [ "ANGLE_ENABLE_GLSL" ] |
| 191 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 192 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 193 | if (angle_enable_hlsl) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 194 | sources += |
| 195 | rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 196 | defines += [ "ANGLE_ENABLE_HLSL" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 197 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 198 | configs -= angle_undefine_configs |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 199 | configs += [ |
| 200 | ":internal_config", |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 201 | ":translator_static_config", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 202 | "//build/config/compiler:no_chromium_code", |
| 203 | ] |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 204 | public_configs = [ ":external_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 205 | |
| 206 | deps = [ |
| 207 | ":includes", |
| 208 | ":preprocessor", |
| 209 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 210 | |
| 211 | public_deps = [ |
| 212 | ":angle_common", |
| 213 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 214 | } |
| 215 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 216 | static_library("translator_static") { |
| 217 | sources = [ |
| 218 | "src/compiler/translator/ShaderLang.cpp", |
Jamie Madill | a2ad4e8 | 2014-07-17 14:16:32 -0400 | [diff] [blame] | 219 | "src/compiler/translator/ShaderVars.cpp", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 220 | ] |
| 221 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 222 | if (angle_enable_hlsl) { |
| 223 | defines = [ "ANGLE_ENABLE_HLSL" ] |
| 224 | } |
| 225 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 226 | configs -= angle_undefine_configs |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 227 | configs += [ |
| 228 | ":internal_config", |
| 229 | "//build/config/compiler:no_chromium_code", |
| 230 | ] |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 231 | public_configs = [ ":translator_static_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 232 | |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 233 | public_deps = [ |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 234 | ":translator_lib", |
| 235 | ] |
| 236 | } |
| 237 | |
| 238 | config("commit_id_config") { |
| 239 | include_dirs = [ "$root_gen_dir/angle" ] |
| 240 | } |
| 241 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 242 | commit_id_output_file = "$root_gen_dir/angle/id/commit.h" |
| 243 | if (angle_use_commit_id) { |
| 244 | action("commit_id") { |
| 245 | script = "src/commit_id.py" |
| 246 | outputs = [ |
| 247 | commit_id_output_file, |
| 248 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 249 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 250 | args = [ |
| 251 | "gen", |
| 252 | rebase_path(".", root_build_dir), |
| 253 | rebase_path(commit_id_output_file, root_build_dir), |
| 254 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 255 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 256 | public_configs = [ ":commit_id_config" ] |
| 257 | } |
| 258 | } else { |
| 259 | copy("commit_id") { |
| 260 | sources = [ |
| 261 | "src/commit.h", |
| 262 | ] |
| 263 | outputs = [ |
| 264 | commit_id_output_file, |
| 265 | ] |
| 266 | public_configs = [ ":commit_id_config" ] |
| 267 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 268 | } |
| 269 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 270 | config("libANGLE_config") { |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 271 | cflags = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 272 | defines = [] |
| 273 | if (angle_enable_d3d9) { |
| 274 | defines += [ "ANGLE_ENABLE_D3D9" ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 275 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 276 | if (angle_enable_d3d11) { |
| 277 | defines += [ "ANGLE_ENABLE_D3D11" ] |
| 278 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 279 | if (angle_enable_gl) { |
| 280 | defines += [ "ANGLE_ENABLE_OPENGL" ] |
Steven Bennetts | 369d03c | 2016-05-05 10:37:38 -0700 | [diff] [blame] | 281 | if (use_x11) { |
| 282 | defines += [ "ANGLE_USE_X11" ] |
| 283 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 284 | } |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 285 | if (angle_enable_vulkan) { |
| 286 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 287 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 288 | defines += [ |
Geoff Lang | ee48376 | 2015-09-15 13:12:07 -0400 | [diff] [blame] | 289 | "GL_GLEXT_PROTOTYPES", |
Austin Kinross | 502f3df | 2015-12-02 12:33:18 -0800 | [diff] [blame] | 290 | "EGL_EGLEXT_PROTOTYPES", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 291 | ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 292 | |
| 293 | if (is_win) { |
| 294 | defines += [ |
| 295 | "GL_APICALL=", |
| 296 | "EGLAPI=", |
| 297 | ] |
| 298 | } else { |
| 299 | defines += [ |
| 300 | "GL_APICALL=__attribute__((visibility(\"default\")))", |
| 301 | "EGLAPI=__attribute__((visibility(\"default\")))", |
| 302 | ] |
| 303 | } |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 304 | if (is_win) { |
| 305 | cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled. |
| 306 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 307 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 308 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 309 | static_library("libANGLE") { |
| 310 | sources = rebase_path(gles_gypi.libangle_sources, ".", "src") |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 311 | |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 312 | include_dirs = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 313 | libs = [] |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 314 | defines = [ "LIBANGLE_IMPLEMENTATION" ] |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 315 | public_deps = [ |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 316 | ":angle_common", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 317 | ] |
| 318 | deps = [ |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 319 | ":angle_image_util", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 320 | ":commit_id", |
| 321 | ":includes", |
| 322 | ":translator_static", |
| 323 | ] |
| 324 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 325 | # Shared D3D sources. |
| 326 | if (angle_enable_d3d9 || angle_enable_d3d11) { |
| 327 | sources += rebase_path(gles_gypi.libangle_d3d_shared_sources, ".", "src") |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 328 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 329 | 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] | 330 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 331 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 332 | if (angle_enable_d3d9) { |
| 333 | sources += rebase_path(gles_gypi.libangle_d3d9_sources, ".", "src") |
| 334 | libs += [ "d3d9.lib" ] |
| 335 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 336 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 337 | if (angle_enable_d3d11) { |
| 338 | sources += rebase_path(gles_gypi.libangle_d3d11_sources, ".", "src") |
| 339 | sources += rebase_path(gles_gypi.libangle_d3d11_win32_sources, ".", "src") |
| 340 | libs += [ "dxguid.lib" ] |
| 341 | } |
| 342 | |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 343 | if (angle_enable_gl) { |
| 344 | sources += rebase_path(gles_gypi.libangle_gl_sources, ".", "src") |
| 345 | include_dirs += [ "src/third_party/khronos" ] |
| 346 | |
| 347 | if (is_win) { |
| 348 | sources += rebase_path(gles_gypi.libangle_gl_wgl_sources, ".", "src") |
| 349 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 350 | if (use_x11) { |
Corentin Wallez | 47fc1fe | 2015-05-14 10:54:18 -0400 | [diff] [blame] | 351 | sources += rebase_path(gles_gypi.libangle_gl_glx_sources, ".", "src") |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 352 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 353 | libs += [ |
| 354 | "X11", |
| 355 | "Xi", |
| 356 | "Xext", |
| 357 | ] |
Corentin Wallez | 47fc1fe | 2015-05-14 10:54:18 -0400 | [diff] [blame] | 358 | } |
Nico Weber | de44d3a | 2016-05-13 17:27:57 -0400 | [diff] [blame] | 359 | if (is_mac) { |
| 360 | sources += rebase_path(gles_gypi.libangle_gl_cgl_sources, ".", "src") |
| 361 | libs += [ |
| 362 | "Cocoa.framework", |
| 363 | "IOSurface.framework", |
| 364 | "OpenGL.framework", |
| 365 | "QuartzCore.framework", |
| 366 | ] |
| 367 | } |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 368 | if (is_android) { |
| 369 | sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src") |
| 370 | sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src") |
| 371 | sources += |
| 372 | rebase_path(gles_gypi.libangle_gl_egl_android_sources, ".", "src") |
| 373 | libs += [ |
| 374 | "android", |
| 375 | "log", |
| 376 | ] |
| 377 | } |
Frank Henigman | e8d5c5c | 2016-07-07 13:17:47 -0400 | [diff] [blame] | 378 | if (ozone_platform_gbm) { |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 379 | configs += [ ":libdrm" ] |
| 380 | defines += [ "ANGLE_USE_OZONE" ] |
| 381 | deps += [ "//third_party/minigbm" ] |
| 382 | sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src") |
| 383 | sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src") |
| 384 | sources += rebase_path(gles_gypi.libangle_gl_ozone_sources, ".", "src") |
| 385 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 386 | } |
| 387 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 388 | if (angle_enable_vulkan) { |
| 389 | sources += rebase_path(gles_gypi.libangle_vulkan_sources, ".", "src") |
| 390 | } |
| 391 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 392 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 393 | defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 394 | } |
| 395 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 396 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 397 | configs += [ |
| 398 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 399 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 400 | ":libANGLE_config", |
| 401 | ":internal_config", |
| 402 | "//build/config/compiler:no_chromium_code", |
| 403 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 404 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 405 | if (is_win) { |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 406 | data_deps = [ |
| 407 | ":copy_compiler_dll", |
| 408 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 409 | } |
| 410 | } |
| 411 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 412 | config("shared_library_public_config") { |
| 413 | if (is_mac && !is_component_build) { |
| 414 | # Executable targets that depend on the shared libraries below need to have |
| 415 | # the rpath setup in non-component build configurations. |
| 416 | ldflags = [ "-rpath", "@executable_path/" ] |
| 417 | } |
| 418 | } |
| 419 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 420 | shared_library("libGLESv2") { |
| 421 | sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src") |
| 422 | |
| 423 | if (is_win) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 424 | ldflags = |
| 425 | [ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 426 | } |
John Abd-El-Malek | 657cd68 | 2014-11-05 14:04:19 -0800 | [diff] [blame] | 427 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 428 | if (is_mac && !is_component_build) { |
| 429 | ldflags = [ "-install_name", "@rpath/${target_name}.dylib" ] |
| 430 | public_configs = [ ":shared_library_public_config" ] |
| 431 | } |
| 432 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 433 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 434 | configs += [ |
| 435 | ":internal_config", |
| 436 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 437 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 438 | ":libANGLE_config", |
| 439 | "//build/config/compiler:no_chromium_code", |
| 440 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 441 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 442 | defines = [ "LIBGLESV2_IMPLEMENTATION" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 443 | |
| 444 | deps = [ |
| 445 | ":includes", |
| 446 | ":libANGLE", |
| 447 | ] |
| 448 | } |
| 449 | |
| 450 | shared_library("libEGL") { |
| 451 | sources = rebase_path(gles_gypi.libegl_sources, ".", "src") |
| 452 | |
| 453 | if (is_win) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 454 | ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 455 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 456 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 457 | if (is_mac && !is_component_build) { |
| 458 | ldflags = [ "-install_name", "@rpath/${target_name}.dylib" ] |
| 459 | public_configs = [ ":shared_library_public_config" ] |
| 460 | } |
| 461 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 462 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 463 | configs += [ |
| 464 | ":internal_config", |
| 465 | ":commit_id_config", |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 466 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 467 | ":libANGLE_config", |
| 468 | "//build/config/compiler:no_chromium_code", |
| 469 | ] |
| 470 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 471 | defines = [ "LIBEGL_IMPLEMENTATION" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 472 | |
| 473 | deps = [ |
| 474 | ":includes", |
| 475 | ":libGLESv2", |
| 476 | ] |
| 477 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 478 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 479 | util_gypi = exec_script("//build/gypi_to_gn.py", |
| 480 | [ rebase_path("util/util.gyp") ], |
| 481 | "scope", |
| 482 | [ "util/util.gyp" ]) |
| 483 | |
| 484 | config("angle_util_config") { |
| 485 | include_dirs = [ "util" ] |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 486 | if (is_linux && use_x11) { |
Jamie Madill | 1fae355 | 2016-01-07 14:33:48 -0500 | [diff] [blame] | 487 | libs = [ "X11" ] |
| 488 | } |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 489 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 490 | |
| 491 | static_library("angle_util") { |
| 492 | sources = rebase_path(util_gypi.util_sources, ".", "util") |
| 493 | |
| 494 | if (is_win) { |
| 495 | sources += rebase_path(util_gypi.util_win32_sources, ".", "util") |
| 496 | } |
| 497 | |
| 498 | if (is_linux) { |
| 499 | sources += rebase_path(util_gypi.util_linux_sources, ".", "util") |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 500 | libs = [ |
| 501 | "rt", |
| 502 | "dl", |
| 503 | ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | if (is_mac) { |
| 507 | sources += rebase_path(util_gypi.util_osx_sources, ".", "util") |
| 508 | } |
| 509 | |
| 510 | if (use_x11) { |
| 511 | sources += rebase_path(util_gypi.util_x11_sources, ".", "util") |
| 512 | } |
| 513 | |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 514 | if (is_android) { |
| 515 | # To prevent linux sources filtering on android |
| 516 | set_sources_assignment_filter([]) |
| 517 | sources += rebase_path(util_gypi.util_linux_sources, ".", "util") |
| 518 | sources += rebase_path(util_gypi.util_android_sources, ".", "util") |
| 519 | libs = [ |
| 520 | "android", |
| 521 | "log", |
| 522 | ] |
| 523 | } |
| 524 | |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 525 | if (use_ozone) { |
| 526 | sources += rebase_path(util_gypi.util_ozone_sources, ".", "util") |
| 527 | } |
| 528 | |
Geoff Lang | ee48376 | 2015-09-15 13:12:07 -0400 | [diff] [blame] | 529 | defines = [ |
| 530 | "GL_GLEXT_PROTOTYPES", |
| 531 | "EGL_EGLEXT_PROTOTYPES", |
| 532 | ] |
| 533 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 534 | configs += [ ":debug_annotations_config" ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 535 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 536 | public_configs = [ |
| 537 | ":angle_util_config", |
| 538 | ":internal_config", |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 539 | ] |
| 540 | |
| 541 | deps = [ |
Jamie Madill | 1fae355 | 2016-01-07 14:33:48 -0500 | [diff] [blame] | 542 | ":angle_common", |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 543 | ":libEGL", |
| 544 | ":libGLESv2", |
| 545 | ] |
| 546 | } |