aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamie Madill <jmadill@chromium.org>2021-09-09 17:26:56 -0400
committerAngle LUCI CQ <angle-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-09-10 00:19:23 +0000
commit1a3b17dacdb021b0748c356a3e9f4e6fd185e34c (patch)
tree875d6f3c1b6dff45220a0969a193e23403e82b55
parent13e9817b74cca2a57b4dd81a8affb5513b2a834a (diff)
downloadplatform_external_angle-1a3b17dacdb021b0748c356a3e9f4e6fd185e34c.tar.gz
platform_external_angle-1a3b17dacdb021b0748c356a3e9f4e6fd185e34c.tar.bz2
platform_external_angle-1a3b17dacdb021b0748c356a3e9f4e6fd185e34c.zip
Capture/Replay: Fix GN build when JSON not available.
This change makes it so we no longer build frame capture when JSON is not available. In Skia's build this is the case. Also updates the GN scripts to use a new variable 'angle_has_frame_capture'. Bug: angleproject:5133 Bug: angleproject:6374 Change-Id: I30290a160f6ebe6419f371e36d304a61bf0a85ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3152557 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
-rw-r--r--BUILD.gn47
-rw-r--r--gni/angle.gni3
-rw-r--r--util/BUILD.gn2
3 files changed, 30 insertions, 22 deletions
diff --git a/BUILD.gn b/BUILD.gn
index f88a41950..c42851034 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -930,10 +930,6 @@ config("angle_frame_capture_disabled") {
defines = [ "ANGLE_CAPTURE_ENABLED=0" ]
}
-config("angle_frame_capture_enabled") {
- defines = [ "ANGLE_CAPTURE_ENABLED=1" ]
-}
-
angle_source_set("libANGLE") {
public_deps = [ ":libANGLE_base" ]
public_configs = [ ":angle_frame_capture_disabled" ]
@@ -1021,17 +1017,24 @@ if (angle_has_rapidjson) {
}
}
-angle_source_set("libANGLE_with_capture") {
- public_deps = [ ":libANGLE_base" ]
- deps = [ ":angle_compression" ]
- public_configs = [ ":angle_frame_capture_enabled" ]
- sources = libangle_capture_sources
+assert(angle_has_frame_capture || !angle_with_capture_by_default)
+if (angle_has_frame_capture) {
+ config("angle_frame_capture_enabled") {
+ defines = [ "ANGLE_CAPTURE_ENABLED=1" ]
+ }
- if (angle_has_rapidjson) {
- public_deps += [ ":angle_json_serializer" ]
- sources += [ "src/libANGLE/capture/frame_capture_utils.cpp" ]
- } else {
- sources += [ "src/libANGLE/capture/frame_capture_utils_mock.cpp" ]
+ angle_source_set("libANGLE_with_capture") {
+ public_deps = [ ":libANGLE_base" ]
+ deps = [ ":angle_compression" ]
+ public_configs = [ ":angle_frame_capture_enabled" ]
+ sources = libangle_capture_sources
+
+ if (angle_has_rapidjson) {
+ public_deps += [ ":angle_json_serializer" ]
+ sources += [ "src/libANGLE/capture/frame_capture_utils.cpp" ]
+ } else {
+ sources += [ "src/libANGLE/capture/frame_capture_utils_mock.cpp" ]
+ }
}
}
@@ -1133,13 +1136,15 @@ angle_libGLESv2("libGLESv2") {
}
# Output capture lib when `angle_with_capture_by_default` disabled, vice versa.
-angle_libGLESv2("libGLESv2_capture_complement") {
- if (angle_with_capture_by_default) {
- deps = [ ":libANGLE" ]
- output_name += "_no_capture"
- } else {
- deps = [ ":libANGLE_with_capture" ]
- output_name += "_with_capture"
+if (angle_has_frame_capture) {
+ angle_libGLESv2("libGLESv2_capture_complement") {
+ if (angle_with_capture_by_default) {
+ deps = [ ":libANGLE" ]
+ output_name += "_no_capture"
+ } else {
+ deps = [ ":libANGLE_with_capture" ]
+ output_name += "_with_capture"
+ }
}
}
diff --git a/gni/angle.gni b/gni/angle.gni
index 5706d6f4d..747070172 100644
--- a/gni/angle.gni
+++ b/gni/angle.gni
@@ -117,6 +117,9 @@ declare_args() {
# Currently Windows on Arm doesn't support OpenGL or Vulkan.
is_win_arm64 = is_win && target_cpu == "arm64"
+
+ # Frame capture code is enabled by default if rapidjson is available.
+ angle_has_frame_capture = angle_has_rapidjson
}
declare_args() {
diff --git a/util/BUILD.gn b/util/BUILD.gn
index d2019244f..5f3ff328f 100644
--- a/util/BUILD.gn
+++ b/util/BUILD.gn
@@ -153,7 +153,7 @@ angle_source_set("angle_util_loader") {
]
}
-if (angle_has_rapidjson) {
+if (angle_has_frame_capture) {
angle_source_set("angle_frame_capture_test_utils") {
testonly = true
sources = [