| # 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. |
| |
| import("//third_party/fuchsia-sdk/build/component.gni") |
| import("//third_party/fuchsia-sdk/build/package.gni") |
| import("//third_party/fuchsia-sdk/build/test.gni") |
| |
| #tests group |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":rot13_unittests", |
| ":rot13_unittests_package", |
| ] |
| } |
| |
| # Keep the app in a lib component so it can be reused by tests |
| source_set("impl_lib") { |
| sources = [ |
| "rot13.cc", |
| "rot13.h", |
| ] |
| } |
| |
| source_set("server_lib") { |
| sources = [ |
| "rot13_server_app.cc", |
| "rot13_server_app.h", |
| ] |
| |
| public_deps = [ |
| "//src/rot13/fidl:fuchsia.examples.rot13", |
| "//third_party/fuchsia-sdk/pkg/sys_cpp", |
| ] |
| deps = [ |
| ":impl_lib", |
| ] |
| } |
| |
| executable("rot13_server_bin") { |
| sources = [ |
| "rot13_server.cc", |
| ] |
| |
| deps = [ |
| ":server_lib", |
| "//third_party/fuchsia-sdk/pkg/async-loop-cpp", |
| "//third_party/fuchsia-sdk/pkg/async-loop-default", |
| ] |
| } |
| |
| # Fuchsia components and packages |
| fuchsia_component("server_component") { |
| manifest = "meta/rot13_server.cml" |
| data_deps = [ |
| ":rot13_server_bin", |
| ] |
| } |
| |
| fuchsia_package("rot13_server") { |
| deps = [ |
| ":server_component", |
| ] |
| } |
| |
| fuchsia_test("rot13_unittests") { |
| manifest = "meta/rot13_unittests.cml" |
| sources = [ |
| "rot13_unittests.cc", |
| ] |
| deps = [ |
| ":impl_lib", |
| "//third_party/googletest:gtest", |
| "//third_party/googletest:gtest_main", |
| ] |
| } |