blob: c1ce5fd2dc4ba785acc34b6bc28c714d8f070e73 [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_bind_cc_library",
"fuchsia_bind_library",
"fuchsia_fidl_bind_library",
"fuchsia_fidl_library",
"fuchsia_fidl_llcpp_library",
)
# TODO(fxbug.dev/106882): Apply visibility to rules once available
package(default_visibility = ["//visibility:public"])
#[START fuchsia_gizmo_library]
# This is a bind library that we manually define.
fuchsia_bind_library(
name = "fuchsia.examples.gizmo.bind",
srcs = [
"testlibrary.bind",
],
deps = [
"@fuchsia_sdk//bind/fuchsia.acpi", # An SDK bind library.
],
)
# We have to create the C++ library for it manually as well.
fuchsia_bind_cc_library(
name = "fuchsia.examples.gizmo.bind_cc",
library = ":fuchsia.examples.gizmo.bind",
# Has to have the C++ libraries of all the deps of the bind library.
deps = [
"@fuchsia_sdk//bind/fuchsia.acpi:fuchsia.acpi_cc", # An SDK bind library's C++ lib.
],
)
#[END fuchsia_gizmo_library]
#[START fuchsia_gizmo_protocol]
# This is a FIDL library that we manually define.
fuchsia_fidl_library(
name = "fuchsia.examples.gizmo",
srcs = [
"testfidl.fidl",
],
library = "fuchsia.examples.gizmo",
)
# The C++ bindings for the FIDL library.
fuchsia_fidl_llcpp_library(
name = "fuchsia.examples.gizmo_cc",
library = ":fuchsia.examples.gizmo",
deps = [
"@fuchsia_sdk//pkg/fidl_cpp_wire",
"@fuchsia_sdk//pkg/fidl_cpp_v2",
],
)
# We have to manually create the bind library from it.
fuchsia_fidl_bind_library(
name = "fuchsia.examples.gizmo_bindlib",
library = ":fuchsia.examples.gizmo",
)
# We have to manually create the C++ lib for the FIDL based bind library we created.
fuchsia_bind_cc_library(
name = "fuchsia.examples.gizmo_bindlib_cc",
library = ":fuchsia.examples.gizmo_bindlib",
)
#[END fuchsia_gizmo_protocol]