| # Copyright 2019 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. |
| |
| assert(is_fuchsia, "These targets are only compiled in the fuchsia toolchain.") |
| |
| import("//build/components.gni") |
| |
| group("cpp") { |
| testonly = true |
| public_deps = [ |
| ":hermetic_tests", |
| ":inspect-example-cpp", |
| ] |
| } |
| |
| group("hermetic_tests") { |
| testonly = true |
| public_deps = [ ":inspect-example-cpp-tests" ] |
| } |
| |
| source_set("lib") { |
| sources = [ |
| "echo_connection.cc", |
| "echo_connection.h", |
| "example_server_app.cc", |
| "example_server_app.h", |
| ] |
| |
| public_deps = [ |
| "//examples/components/routing/fidl:echo_hlcpp", |
| "//sdk/lib/fidl/cpp", |
| |
| # [START inspect_libs] |
| "//sdk/lib/inspect/component/cpp", |
| "//sdk/lib/sys/cpp", |
| |
| # [END inspect_libs] |
| ] |
| } |
| |
| executable("server_bin") { |
| output_name = "inspect_server_cpp" |
| |
| sources = [ "example_server.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("server_component") { |
| component_name = "echo_server" |
| manifest = "meta/echo_server.cml" |
| deps = [ ":server_bin" ] |
| } |
| |
| fuchsia_package("inspect-example-cpp") { |
| deps = [ |
| ":server_component", |
| "//examples/components/routing:echo_realm", |
| "//examples/components/routing/cpp/echo_client:echo_client_cmp", |
| ] |
| } |
| |
| executable("test_bin") { |
| testonly = true |
| output_name = "example_test_bin" |
| sources = [ "example_unittests.cc" ] |
| deps = [ |
| ":lib", |
| "//sdk/lib/inspect/testing/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_unittest_package("inspect-example-cpp-tests") { |
| deps = [ ":test_bin" ] |
| } |