blob: 8dc26db29598b96353ec27b3dbd328617935fc0e [file] [log] [blame]
# Copyright 2022 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 = [
":greeting_service_pkg",
":greeter_test_pkg",
]
}
# Build the greeter component implementation
executable("greeter_exe") {
sources = [ "greeter.cc" ]
deps = [
"//src/realm_builder/fidl:fuchsia.sdk.examples.fidl",
"//third_party/fuchsia-sdk/pkg/async-loop-cpp",
"//third_party/fuchsia-sdk/pkg/async-loop-default",
"//third_party/fuchsia-sdk/pkg/fidl_cpp",
"//third_party/fuchsia-sdk/pkg/sys_cpp",
]
}
fuchsia_component("greeting_service") {
manifest = "meta/greeting_service.cml"
data_deps = [ ":greeter_exe" ]
}
fuchsia_component("greeting_service_v1") {
manifest = "meta/greeting_service.cmx"
data_deps = [ ":greeter_exe" ]
}
# Component package contains both a CML and CMX implementation of greeter
fuchsia_package("greeting_service_pkg") {
testonly = true
package_name = "greeting_service"
deps = [
":greeting_service",
":greeting_service_v1",
]
}
# Build the greeter integration test component
executable("greeter_test_exe") {
testonly = true
sources = [ "test/realm_builder_test.cc" ]
deps = [
"//src/realm_builder/fidl:fuchsia.sdk.examples.fidl",
"//third_party/fuchsia-sdk/fidl/fuchsia.logger",
"//third_party/fuchsia-sdk/pkg/async",
"//third_party/fuchsia-sdk/pkg/async-default",
"//third_party/fuchsia-sdk/pkg/async-loop-cpp",
"//third_party/fuchsia-sdk/pkg/async-loop-default",
"//third_party/fuchsia-sdk/pkg/fidl_cpp",
"//third_party/fuchsia-sdk/pkg/fit",
"//third_party/fuchsia-sdk/pkg/sys_component_cpp_testing",
"//third_party/fuchsia-sdk/pkg/zx",
"//third_party/googletest:gtest",
"//third_party/googletest:gtest_main",
]
}
fuchsia_component("greeter_test") {
testonly = true
manifest = "meta/greeter_test.cml"
data_deps = [ ":greeter_test_exe" ]
}
# Test package that also bundles the CML implementation of greeter
fuchsia_package("greeter_test_pkg") {
testonly = true
package_name = "greeter_test"
deps = [
":greeter_test",
":greeting_service",
]
}