blob: 51ec84a39a77857080ca2b74eaaed31084b51228 [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.
load(
"@rules_fuchsia//fuchsia:defs.bzl",
"fuchsia_cc_binary",
"fuchsia_cc_test",
"fuchsia_component",
"fuchsia_component_manifest",
"fuchsia_package",
"fuchsia_unittest_package",
"if_fuchsia",
)
fuchsia_cc_binary(
name = "hello_world_cpp",
srcs = [
"main.cc",
],
deps = [
"@fuchsia_sdk//fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_cpp_driver",
"@fuchsia_sdk//fidl/fuchsia.mem:fuchsia.mem_hlcpp",
"@fuchsia_sdk//pkg/fdio",
"@fuchsia_sdk//pkg/syslog",
],
)
fuchsia_component_manifest(
name = "manifest",
src = "meta/hello_world_cpp.cml",
)
fuchsia_component(
name = "component",
manifest = ":manifest",
deps = [
":hello_world_cpp",
],
)
fuchsia_package(
name = "pkg",
package_name = "hello_world_cpp",
components = [":component"],
resources = [
"//examples/hello_world_cpp/resources:assets",
"//examples/hello_world_cpp/resources:text_file",
],
visibility = ["//visibility:public"],
)
fuchsia_cc_test(
name = "hello_test",
size = "small",
srcs = ["hello_test.cc"],
visibility = ["//visibility:public"],
deps = [
"@com_google_googletest//:gtest_main",
] + if_fuchsia([
"@fuchsia_sdk//pkg/fdio",
"@fuchsia_sdk//pkg/syslog",
]),
)
fuchsia_unittest_package(
name = "test_pkg",
package_name = "hello_tests",
unit_tests = [
":hello_test",
],
visibility = ["//visibility:public"],
)