From f60522f5a4670f98e6d459a677122a2d4f89f3ad Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Tue, 10 Sep 2019 13:01:59 +0000 Subject: [PATCH] [fuchsia] Fix Chromium build. For some unknown reason, during the Chromium build, the third_party/dawn/third_party:glfw always get rebuilt even when nothing actually references is (as is the case for "is_fuchsia == true"). This ends up in a build failure, since glfw doesn't support this platform. See [1] for an example. This CL is a work-around that makes the library empty for Fuchsia instead. Note that this is never linked into anything so should not be an issue for any Chromium-related code either. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1795302 Bug=dawn:221 Change-Id: Ia4344e93b01722b3dd0cddf70a5d13a5b71488b7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11041 Commit-Queue: David Turner Commit-Queue: Corentin Wallez Reviewed-by: Corentin Wallez --- third_party/BUILD.gn | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index 4a52372eec..53e56db970 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn @@ -265,21 +265,26 @@ static_library("glfw") { ] } - sources = [ - "${glfw_dir}/include/GLFW/glfw3.h", - "${glfw_dir}/include/GLFW/glfw3native.h", - "${glfw_dir}/src/context.c", - "${glfw_dir}/src/egl_context.c", - "${glfw_dir}/src/egl_context.h", - "${glfw_dir}/src/init.c", - "${glfw_dir}/src/input.c", - "${glfw_dir}/src/internal.h", - "${glfw_dir}/src/monitor.c", - "${glfw_dir}/src/osmesa_context.c", - "${glfw_dir}/src/osmesa_context.h", - "${glfw_dir}/src/vulkan.c", - "${glfw_dir}/src/window.c", - ] + # NOTE: For some unknown reason, this library gets build when is_fuchsia + # is true, even if absolutely nothing references it, as checked with + # `gn refs out/Fuchsia third_party/dawn/third_party:glfw --all` + if (!is_fuchsia) { + sources = [ + "${glfw_dir}/include/GLFW/glfw3.h", + "${glfw_dir}/include/GLFW/glfw3native.h", + "${glfw_dir}/src/context.c", + "${glfw_dir}/src/egl_context.c", + "${glfw_dir}/src/egl_context.h", + "${glfw_dir}/src/init.c", + "${glfw_dir}/src/input.c", + "${glfw_dir}/src/internal.h", + "${glfw_dir}/src/monitor.c", + "${glfw_dir}/src/osmesa_context.c", + "${glfw_dir}/src/osmesa_context.h", + "${glfw_dir}/src/vulkan.c", + "${glfw_dir}/src/window.c", + ] + } libs = [] if (is_win) {