blob: 5fda83ca8ddd8778dc9469771affd4a929b3d2df [file] [log] [blame]
# 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.
# This file was generated by the `fx create` command. The template
# is located at `//tools/create/templates/component-v2/BUILD.gn.tmpl-cpp`.
# If you find something broken, we are eager to review fixes.
import("//src/sys/build/components.gni")
group("my-component-v2-cpp") {
testonly = true
deps = [
":package",
":tests",
]
}
group("tests") {
testonly = true
deps = [ ":my-component-v2-cpp-unittests" ]
}
source_set("lib") {
sources = [
"my_component_v2_cpp.cc",
"my_component_v2_cpp.h",
]
public_deps = [
"//sdk/lib/sys/inspect/cpp",
"//sdk/lib/syslog/cpp",
"//zircon/public/lib/async",
"//zircon/public/lib/async-cpp",
]
}
executable("bin") {
output_name = "my-component-v2-cpp"
sources = [ "main.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("component") {
component_name = "my-component-v2-cpp"
manifest = "meta/my-component-v2-cpp.cml"
deps = [ ":bin" ]
}
fuchsia_package("package") {
package_name = "my-component-v2-cpp"
deps = [ ":component" ]
}
executable("unittests") {
output_name = "my-component-v2-cpp_test"
testonly = true
sources = [ "my_component_v2_cpp_unittest.cc" ]
deps = [
":lib",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
# Run with `fx test my-component-v2-cpp-unittests`.
fuchsia_unittest_package("my-component-v2-cpp-unittests") {
manifest = "meta/my-component-v2-cpp-unittests.cml"
deps = [ ":unittests" ]
}