Commit eea73325 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Structuring GpuPreferences dependencies

The mojo type GpuPreferences did not depend on the implementation
classes. Since the implementation classes in turn depends on
the mojo bindings, there is a dependency cycle. This patch
describes that in the build system in a way that is accepted
by gn check --check-generated

An example of an error:

ERROR at //out/Default/gen/gpu/ipc/common/gpu_preferences.mojom-forward.h:40:11: Include not allowed.
#include "gpu/config/gpu_preferences.h"
          ^---------------------------
It is not in any dependency of
  //gpu/ipc/common:gpu_preferences_interface
The include file is in the target(s):
  //gpu/config:config_sources
which should somehow be reachable.
___________________


Bug: 938893
Change-Id: I18a9c0c8684ffbbdbe5d47573150434de397061f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538423
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644620}
parent 4951ed56
...@@ -161,6 +161,11 @@ jumbo_source_set("config_sources") { ...@@ -161,6 +161,11 @@ jumbo_source_set("config_sources") {
"//ui/gl/init", "//ui/gl/init",
] ]
# GpuPreferences is using its own mojo bindings which creates a
# cycle between this target and gpu_preferences_interface.
allow_circular_includes_from =
[ "//gpu/ipc/common:gpu_preferences_interface" ]
# Prefer mesa GL headers to system headers, which cause problems on Win. # Prefer mesa GL headers to system headers, which cause problems on Win.
include_dirs = [ "//third_party/mesa_headers" ] include_dirs = [ "//third_party/mesa_headers" ]
......
...@@ -8,6 +8,15 @@ traits_headers = [ "//gpu/ipc/common/gpu_preferences_struct_traits.h" ] ...@@ -8,6 +8,15 @@ traits_headers = [ "//gpu/ipc/common/gpu_preferences_struct_traits.h" ]
public_deps = [ public_deps = [
"//media:media_buildflags", "//media:media_buildflags",
] ]
deps = [
# We depend on gpu_preferences but since it also depends on its own
# mojo bindings, that is handled with an |allowed_circular_includes|
# in //gpu/config:gpu_preferences.
# "//gpu/config:gpu_preferences",
]
sources = [
"//gpu/ipc/common/gpu_preferences_struct_traits.h",
]
type_mappings = [ type_mappings = [
"gpu.mojom.GpuPreferences=gpu::GpuPreferences", "gpu.mojom.GpuPreferences=gpu::GpuPreferences",
"gpu.mojom.VpxDecodeVendors=gpu::GpuPreferences::VpxDecodeVendors", "gpu.mojom.VpxDecodeVendors=gpu::GpuPreferences::VpxDecodeVendors",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment