| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| import("//tools/cmc/build/expect_includes.gni") |
| |
| # Provides a C++ implementation of fuchsia.hardware.display.Provider, which returns a connection to |
| # the default display controller (via a proxied connection to the driver-provided version). This |
| # makes it easy for a component to use and implement this service. |
| # |
| # NOTE: the component must contain the following statement in its manifest: |
| # ``` |
| # use: [ |
| # { |
| # directory: "dev-display-coordinator", |
| # rights: [ "r*" ], |
| # path: "/dev/class/display-coordinator", |
| # }, |
| # ] |
| # ``` |
| source_set("devfs_factory") { |
| sources = [ |
| "devfs-factory.cc", |
| "devfs-factory.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.display:fuchsia.hardware.display_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/fidl/cpp", |
| "//src/lib/fsl", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.display:fuchsia.hardware.display_cpp", |
| "//sdk/lib/sys/cpp", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/fbl", |
| ] |
| visibility = [ ":*" ] |
| } |
| |
| executable("bin") { |
| output_name = "display_coordinator_connector" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":devfs_factory", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/trace-provider", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| manifest = "meta/display_coordinator_connector.cml" |
| component_name = "display-coordinator-connector" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("coordinator-connector") { |
| package_name = "display-coordinator-connector" |
| deps = [ ":component" ] |
| } |
| |
| expect_includes("shard-includes") { |
| includes = [ "meta/display_coordinator_connector.shard.cml" ] |
| } |
| |
| # Includes `component` as a child component |
| # and performs "includes" check for the real display coordinator provider |
| # shard in the component manifest. |
| # |
| # Only supports statically defined components; do not use this on realms built |
| # by Realm Builder. |
| group("child-component") { |
| deps = [ |
| ":component", |
| ":shard-includes", |
| ] |
| } |