| # Copyright 2018 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("//build/testing/environments.gni") |
| |
| source_set("lib") { |
| sources = [ |
| "echo_server_app.cc", |
| "echo_server_app.h", |
| ] |
| |
| public_deps = [ |
| "//examples/fidl/legacy/services:echo", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "echo_server_cpp" |
| |
| sources = [ "echo_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", |
| ] |
| } |
| |
| resource("echo_server_file") { |
| sources = [ "${root_build_dir}/echo_server_cpp" ] |
| outputs = [ "bin/echo_server" ] |
| deps = [ ":bin" ] |
| |
| # data_deps is necessary to include shared libraries in package. |
| data_deps = [ ":bin" ] |
| } |
| |
| fuchsia_package_with_single_component("echo_server_cpp") { |
| manifest = "../meta/echo_server.cmx" |
| deps = [ ":echo_server_file" ] |
| } |
| |
| executable("echo_server_cpp_unittests") { |
| testonly = true |
| |
| sources = [ "echo_server_app_unittest.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_unittest_package("echo_server_cpp_tests") { |
| deps = [ ":echo_server_cpp_unittests" ] |
| test_specs = { |
| environments = [ emu_env ] |
| } |
| } |