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