| # 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("//build/components.gni") | |
| import("//build/test.gni") | |
| group("hermetic_tests") { | |
| testonly = true | |
| deps = [ ":hello-world-cpp-unittests" ] | |
| } | |
| # [START cpp_bin] | |
| executable("bin") { | |
| output_name = "hello_world_cpp" | |
| sources = [ "hello_world.cc" ] | |
| } | |
| # [END cpp_bin] | |
| # [START fuchsia_component] | |
| fuchsia_component("hello-world-cpp-component") { | |
| deps = [ ":bin" ] | |
| # Defines the name given to the manifest when included in a fuchsia package. | |
| # In this case: "hello-world-cpp.cm" | |
| component_name = "hello-world-cpp" | |
| manifest = "meta/hello_world_cpp.cml" | |
| } | |
| fuchsia_package("hello-world-cpp") { | |
| deps = [ | |
| # component-url: | |
| # fuchsia-pkg://fuchsia.com/hello-world-cpp#meta/hello-world-cpp.cm | |
| ":hello-world-cpp-component", | |
| ] | |
| } | |
| # [END fuchsia_component] | |
| # [START cpp_test] | |
| executable("unittests") { | |
| testonly = true | |
| output_name = "hello_world_cpp_test_bin" | |
| sources = [ "hello_world_unittest.cc" ] | |
| deps = [ "//src/lib/fxl/test:gtest_main" ] | |
| } | |
| # [END cpp_test] | |
| # [START fuchsia_test] | |
| fuchsia_unittest_package("hello-world-cpp-unittests") { | |
| deps = [ ":unittests" ] | |
| } | |
| # [END fuchsia_test] |