[go: up one dir, main page]

blob: 6e2473c4ddbd82490e406a79379f0a853316b016 [file] [log] [blame]
Jamie Madill9190f492019-12-16 21:03:571# Copyright 2019 The ANGLE Project Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("../gni/angle.gni")
6
Jamie Madill683dd1d2020-01-13 22:21:527_util_sources = [
Wezbb654cf2020-02-15 22:54:448 "EGLPlatformParameters.h",
9 "EGLWindow.cpp",
10 "EGLWindow.h",
11 "Event.h",
12 "Matrix.cpp",
13 "Matrix.h",
14 "OSPixmap.h",
15 "OSWindow.cpp",
16 "OSWindow.h",
Roman Lavrov21f16cb2023-06-09 21:30:3817 "autogen/angle_features_autogen.cpp",
18 "autogen/angle_features_autogen.h",
Jamie Madill683dd1d2020-01-13 22:21:5219 "com_utils.h",
Jamie Madill683dd1d2020-01-13 22:21:5220 "geometry_utils.cpp",
21 "geometry_utils.h",
Wezbb654cf2020-02-15 22:54:4422 "keyboard.h",
Jamie Madill683dd1d2020-01-13 22:21:5223 "mouse.h",
24 "random_utils.cpp",
25 "random_utils.h",
26 "shader_utils.cpp",
27 "shader_utils.h",
28 "util_export.h",
29 "util_gl.h",
Jamie Madill683dd1d2020-01-13 22:21:5230]
31
32if (is_win) {
33 _util_sources += [ "windows/WGLWindow.h" ]
34 if (!angle_is_winuwp) {
35 _util_sources += [
36 "windows/win32/Win32Pixmap.cpp",
37 "windows/win32/Win32Pixmap.h",
38 "windows/win32/Win32Window.cpp",
39 "windows/win32/Win32Window.h",
40 ]
41 }
42}
43
Xiaoxuan Liu61180d02020-10-12 08:40:1344if (is_linux) {
45 _util_sources += [
46 "display/DisplayPixmap.cpp",
47 "display/DisplayWindow.cpp",
48 "display/DisplayWindow.h",
49 ]
50}
51
Jamie Madill683dd1d2020-01-13 22:21:5252if (angle_use_x11) {
53 _util_sources += [
Antonio Caggiano9ad43bd2021-12-09 15:52:3554 "linux/x11/X11Pixmap.cpp",
55 "linux/x11/X11Pixmap.h",
56 "linux/x11/X11Window.cpp",
57 "linux/x11/X11Window.h",
Jamie Madill683dd1d2020-01-13 22:21:5258 ]
59}
60
Antonio Caggiano9ad43bd2021-12-09 15:52:3561if (angle_use_wayland) {
62 _util_sources += [
63 "linux/wayland/WaylandWindow.cpp",
64 "linux/wayland/WaylandWindow.h",
65 ]
66}
67
68if (angle_use_x11 || angle_use_wayland) {
69 _util_sources += [ "linux/LinuxWindow.cpp" ]
70}
71
Jamie Madill683dd1d2020-01-13 22:21:5272if (is_fuchsia) {
73 _util_sources += [
Geoff Lang4e6f6542020-04-16 20:31:2474 "fuchsia/FuchsiaPixmap.cpp",
75 "fuchsia/FuchsiaPixmap.h",
Jamie Madill683dd1d2020-01-13 22:21:5276 "fuchsia/ScenicWindow.cpp",
77 "fuchsia/ScenicWindow.h",
78 ]
Antonio Caggianofcd6e262022-04-13 13:39:2179} else if (use_ozone && !(angle_use_x11 || angle_use_wayland)) {
Maksim Sisov0a3233f2020-07-29 07:35:0480 # Use X11 impl by default otherwise switch to fake Ozone impl that does not
81 # seem to do anything real.
82 # TODO(msisov): probably, we need to have a proper support for different
83 # Ozone backends, and be able to switch between them for proper tests.
84 # For example, Wayland, X11, etc.
Jamie Madill683dd1d2020-01-13 22:21:5285 _util_sources += [
86 "ozone/OzonePixmap.cpp",
87 "ozone/OzoneWindow.cpp",
88 "ozone/OzoneWindow.h",
89 ]
90}
91
92if (is_mac) {
93 _util_sources += [
Jamie Madill683dd1d2020-01-13 22:21:5294 "osx/OSXPixmap.h",
Wezbb654cf2020-02-15 22:54:4495 "osx/OSXPixmap.mm",
Jamie Madill683dd1d2020-01-13 22:21:5296 "osx/OSXWindow.h",
Wezbb654cf2020-02-15 22:54:4497 "osx/OSXWindow.mm",
Jamie Madill683dd1d2020-01-13 22:21:5298 ]
99}
100
James Darpinian0dbe7cd2020-12-08 20:24:35101if (is_ios) {
102 _util_sources += [
103 "ios/IOSPixmap.h",
104 "ios/IOSPixmap.mm",
105 "ios/IOSWindow.h",
106 "ios/IOSWindow.mm",
107 ]
108}
109
Jamie Madill683dd1d2020-01-13 22:21:52110if (is_android) {
111 _util_sources += [
112 "android/AndroidPixmap.cpp",
113 "android/AndroidWindow.cpp",
114 "android/AndroidWindow.h",
115 "android/third_party/android_native_app_glue.c",
116 "android/third_party/android_native_app_glue.h",
117 ]
118}
119
Amirali Abdolrashidif62405c2022-11-01 01:47:52120# Backtrace utils
121if (is_linux) {
122 _util_sources += [ "linux/linux_backtrace.cpp" ]
123}
124
125if (is_fuchsia) {
126 _util_sources += [ "fuchsia/fuchsia_backtrace.cpp" ]
127}
128
129if (is_ios) {
130 _util_sources += [ "ios/ios_backtrace.cpp" ]
131}
132
133if (is_mac) {
134 _util_sources += [ "osx/osx_backtrace.cpp" ]
135}
136
137if (is_android) {
138 _util_sources += [ "android/android_backtrace.cpp" ]
139}
140
Jamie Madill683dd1d2020-01-13 22:21:52141config("angle_util_loader_config") {
142 defines = [ "ANGLE_USE_UTIL_LOADER" ]
143}
144
145config("angle_util_loader_headers_config") {
Jamie Madill5df2c9e2020-03-15 21:28:43146 # Force users to include "util/header.h" instead of just "header.h".
Jamie Madill683dd1d2020-01-13 22:21:52147 include_dirs = [ ".." ]
148}
149
150angle_source_set("angle_util_loader_headers") {
151 testonly = true
152 sources = [
153 "egl_loader_autogen.h",
154 "gles_loader_autogen.h",
155 "util_export.h",
156 ]
157
158 if (is_win && !angle_is_winuwp) {
159 sources += [ "windows/wgl_loader_autogen.h" ]
160 }
161
Wezbb654cf2020-02-15 22:54:44162 public_deps = [ "$angle_root:includes" ]
Jamie Madill683dd1d2020-01-13 22:21:52163
164 public_configs = [ ":angle_util_loader_headers_config" ]
165}
166
167angle_source_set("angle_util_loader") {
168 testonly = true
169 defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
170
171 sources = [
172 "egl_loader_autogen.cpp",
173 "gles_loader_autogen.cpp",
174 ]
175
176 if (is_win && !angle_is_winuwp) {
177 sources += [ "windows/wgl_loader_autogen.cpp" ]
178 }
179
Wezbb654cf2020-02-15 22:54:44180 deps = [ ":angle_util_loader_headers" ]
Jamie Madill683dd1d2020-01-13 22:21:52181
182 public_configs += [
183 "$angle_root:no_gl_prototypes",
184 ":angle_util_config",
185 ":angle_util_loader_config",
186 ":angle_util_loader_headers_config",
187 ]
188}
189
Jamie Madill3da24b52022-05-16 09:58:59190config("angle_trace_loader_config") {
191 include_dirs = [ "$angle_root/util/capture" ]
192}
193
194angle_shared_library("angle_trace_loader") {
195 defines = [ "ANGLE_TRACE_LOADER_IMPLEMENTATION" ]
196
197 sources = [
Jamie Madill3da24b52022-05-16 09:58:59198 "capture/trace_egl_loader_autogen.cpp",
199 "capture/trace_egl_loader_autogen.h",
200 "capture/trace_gles_loader_autogen.cpp",
201 "capture/trace_gles_loader_autogen.h",
202 "capture/traces_export.h",
203 ]
204 deps = [
205 "$angle_root:angle_common",
206 "$angle_root:angle_compression",
207 ]
208
209 public_configs += [
210 "$angle_root:no_gl_prototypes",
211 ":angle_trace_loader_config",
212 ]
213}
214
Jamie Madilld25911d2022-10-11 00:59:53215angle_source_set("angle_trace_fixture") {
216 testonly = true
217 defines = [ "ANGLE_REPLAY_IMPLEMENTATION" ]
218 suppressed_configs += [ "$angle_root:constructor_and_destructor_warnings" ]
219 sources = [
220 "capture/angle_trace_gl.h",
221 "capture/trace_fixture.cpp",
222 "capture/trace_fixture.h",
Roman Lavrov52152932023-06-06 19:36:36223 "capture/trace_interface.h",
Jamie Madilld25911d2022-10-11 00:59:53224 ]
225 public_deps = [
226 ":angle_trace_loader",
Mark Lobodzinski71812392025-04-04 20:13:58227 "$angle_root:angle_capture_common",
Jamie Madilld25911d2022-10-11 00:59:53228 "$angle_root:includes",
229 ]
230 if (is_ios) {
231 # shared libraries are hidden inside ios_framework_bundle, but we include headers from them
232 check_includes = false
233 }
234}
235
Alex Deanc0d806b2025-02-11 07:01:33236if (angle_enable_cl) {
237 angle_source_set("angle_trace_fixture_cl") {
238 testonly = true
239 defines = [ "ANGLE_REPLAY_IMPLEMENTATION" ]
240 suppressed_configs += [ "$angle_root:constructor_and_destructor_warnings" ]
241 sources = [
242 "capture/trace_fixture_cl.cpp",
243 "capture/trace_fixture_cl.h",
244 "capture/trace_interface.h",
245 ]
246 public_deps = [
247 ":angle_trace_loader",
Mark Lobodzinski71812392025-04-04 20:13:58248 "$angle_root:angle_capture_common",
Alex Deanc0d806b2025-02-11 07:01:33249 "$angle_root:includes",
250 ]
251 if (is_ios) {
252 # shared libraries are hidden inside ios_framework_bundle, but we include headers from them
253 check_includes = false
254 }
255 }
256}
257
Jamie Madill61932742022-10-11 01:00:12258if (angle_has_frame_capture) {
259 config("angle_frame_capture_test_utils_config") {
260 include_dirs = [ "$angle_root/util/capture" ]
261 }
262
263 angle_source_set("angle_frame_capture_test_utils") {
264 testonly = true
Cody Northrop35461e62023-04-13 02:02:08265
266 if (restricted_traces_outside_of_apk) {
267 # On Android, if we are building the entire trace library,
268 # we need to load the libraries from outside the APK
269 defines = [ "ANGLE_TRACE_EXTERNAL_BINARIES" ]
270 }
271
Jamie Madill61932742022-10-11 01:00:12272 sources = [
Jamie Madill61932742022-10-11 01:00:12273 "capture/frame_capture_test_utils.cpp",
274 "capture/frame_capture_test_utils.h",
Roman Lavrov52152932023-06-06 19:36:36275 "capture/trace_interface.h",
Roman Lavrov2c7f31a2023-04-13 15:47:34276 ]
277 deps = [ "$angle_root/third_party/rapidjson" ]
278
279 public_configs += [ ":angle_frame_capture_test_utils_config" ]
280 public_deps = [
281 "$angle_root:angle_capture_common",
282 "$angle_root:angle_common",
283 "$angle_root:angle_compression",
284 ]
285 }
286
287 angle_shared_library("angle_trace_interpreter") {
288 testonly = true
289 sources = [
290 "capture/frame_capture_replay_autogen.cpp",
Jamie Madilldc62b3e2022-10-11 01:00:16291 "capture/trace_interpreter.cpp",
292 "capture/trace_interpreter.h",
293 "capture/trace_interpreter_autogen.cpp",
Jamie Madill61932742022-10-11 01:00:12294 ]
295 deps = [
Roman Lavrov2c7f31a2023-04-13 15:47:34296 ":angle_frame_capture_test_utils",
Jamie Madill61932742022-10-11 01:00:12297 ":angle_trace_fixture",
298 ":angle_trace_loader",
Jamie Madill61932742022-10-11 01:00:12299 ]
Roman Lavrov2c7f31a2023-04-13 15:47:34300 defines = [ "ANGLE_REPLAY_IMPLEMENTATION" ]
Jamie Madill61932742022-10-11 01:00:12301 }
302}
303
Jamie Madill683dd1d2020-01-13 22:21:52304config("angle_util_config") {
Jamie Madill5df2c9e2020-03-15 21:28:43305 # Force users to include "util/header.h" instead of just "header.h".
306 include_dirs = [ ".." ]
Hidehiko Abe90a9cf92020-09-10 17:40:34307 if ((is_linux || is_chromeos) && angle_use_x11) {
Jamie Madill683dd1d2020-01-13 22:21:52308 libs = [ "X11" ]
309 }
Antonio Caggiano7b0f6312022-03-30 12:16:02310 configs = [ "$angle_root:angle_vulkan_wayland_config" ]
Jamie Madill683dd1d2020-01-13 22:21:52311}
312
313foreach(is_shared_library,
314 [
315 true,
316 false,
317 ]) {
318 if (is_shared_library) {
319 library_type = "angle_shared_library"
320 library_name = "angle_util"
321 dep_suffix = "${angle_libs_suffix}"
322 } else {
323 library_type = "angle_static_library"
324 library_name = "angle_util_static"
325 dep_suffix = "_static"
326 }
327
328 target(library_type, library_name) {
329 testonly = true
330 sources = _util_sources
Jamie Madill5df2c9e2020-03-15 21:28:43331 public_deps = [
Jamie Madill683dd1d2020-01-13 22:21:52332 ":angle_test_utils",
333 ":angle_util_loader_headers",
Jamie Madill683dd1d2020-01-13 22:21:52334 ]
Jamie Madill683dd1d2020-01-13 22:21:52335 libs = []
336
Hidehiko Abe90a9cf92020-09-10 17:40:34337 if (is_linux || is_chromeos) {
Jamie Madill683dd1d2020-01-13 22:21:52338 libs += [
339 "rt",
340 "dl",
341 ]
342 }
343
Shahbaz Youssefi5b8dec52021-01-12 04:11:56344 if (is_apple) {
James Darpiniandea86292020-12-03 00:26:03345 frameworks = [ "QuartzCore.framework" ]
346 if (is_mac) {
347 frameworks += [ "AppKit.framework" ]
348 }
James Darpinian0dbe7cd2020-12-08 20:24:35349 if (is_ios) {
350 frameworks += [ "UIKit.framework" ]
351 }
Jamie Madill683dd1d2020-01-13 22:21:52352 }
353
354 if (is_android) {
Jamie Madill683dd1d2020-01-13 22:21:52355 libs += [
356 "android",
357 "log",
358 ]
359 }
360
361 configs += [ "$angle_root:debug_annotations_config" ]
362
363 public_configs += [ ":angle_util_config" ]
364
365 if (is_fuchsia) {
366 public_deps += [
367 "$angle_root/src/common/fuchsia_egl",
Caroline Liu879598f2023-11-10 21:38:01368 "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.element",
Wezbb654cf2020-02-15 22:54:44369 "//third_party/fuchsia-sdk/sdk/pkg/async-loop-cpp",
370 "//third_party/fuchsia-sdk/sdk/pkg/async-loop-default",
371 "//third_party/fuchsia-sdk/sdk/pkg/fdio",
Jamie Madill683dd1d2020-01-13 22:21:52372 ]
373 }
374
375 if (is_shared_library) {
376 defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
377
378 public_deps += [ ":angle_util_loader" ]
379
Kyle Piddingtond33a2222021-04-26 23:56:15380 if ((is_mac || is_ios) && !is_component_build) {
Jamie Madill683dd1d2020-01-13 22:21:52381 ldflags = [
382 "-install_name",
383 "@rpath/libangle_util.dylib",
384 ]
385 }
386
387 # Currently excluded from the static build because of build issues.
388 # Would be nice if could be included.
389 if (is_win && !angle_is_winuwp) {
390 sources += [ "windows/WGLWindow.cpp" ]
391 }
392 } else {
393 public_configs += [
Jamie Madillaaee3c22022-11-30 19:24:13394 "$angle_root:angle_static_config",
Jamie Madill683dd1d2020-01-13 22:21:52395 "$angle_root:gl_prototypes",
396 ]
397 }
398 }
399}
400
Jamie Madill9190f492019-12-16 21:03:57401if (is_win && !angle_is_winuwp) {
402 angle_source_set("angle_stack_walker") {
403 sources = [
404 "windows/third_party/StackWalker/src/StackWalker.cpp",
405 "windows/third_party/StackWalker/src/StackWalker.h",
406 ]
407
408 if (is_clang) {
409 cflags_cc = [
410 "-Wno-c++98-compat-extra-semi",
411 "-Wno-missing-declarations",
412 "-Wno-switch",
413 ]
414 } else {
415 cflags_cc = [ "/wd4740" ]
416 }
417 }
418}
419
Jamie Madilld08f1d82020-05-05 16:54:07420config("angle_png_utils_config") {
421 include_dirs = [ ".." ]
422}
423
424angle_source_set("angle_png_utils") {
425 deps = [ "$angle_libpng_dir" ]
426 sources = [
427 "png_utils.cpp",
428 "png_utils.h",
429 ]
430 public_configs = [ ":angle_png_utils_config" ]
431}
432
Jamie Madill9190f492019-12-16 21:03:57433config("angle_test_util_config") {
434 include_dirs = [ ".." ]
435}
436
437angle_source_set("angle_test_utils") {
438 public_configs = [ ":angle_test_util_config" ]
Antonio Caggiano9ad43bd2021-12-09 15:52:35439
Jamie Madill6ca2c112020-07-17 17:07:24440 public_deps = [ "$angle_root:angle_common" ]
Antonio Caggiano9ad43bd2021-12-09 15:52:35441 if (angle_use_wayland) {
442 public_deps += [ "$angle_root:angle_wayland" ]
443 }
444
Jamie Madill6ca2c112020-07-17 17:07:24445 deps = []
Jamie Madill9190f492019-12-16 21:03:57446 sources = [
447 "Timer.cpp",
448 "Timer.h",
449 "test_utils.cpp",
450 "test_utils.h",
451 ]
452
453 if (is_win) {
Jamie Madill5eadaf82020-01-13 22:21:53454 sources += [ "windows/test_utils_win.cpp" ]
455 if (angle_is_winuwp) {
456 sources += [ "windows/test_utils_winuwp.cpp" ]
457 } else {
Jamie Madill9190f492019-12-16 21:03:57458 deps += [ ":angle_stack_walker" ]
Jamie Madill5eadaf82020-01-13 22:21:53459 sources += [ "windows/win32/test_utils_win32.cpp" ]
Jamie Madill9190f492019-12-16 21:03:57460 }
461 } else {
462 sources += [
463 "posix/crash_handler_posix.cpp",
464 "posix/test_utils_posix.cpp",
465 ]
466 }
467}