blob: 132c1e7623304127cae599b5dfd8f6eef8dd403b [file] [log] [blame] [edit]
# 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(
"@fuchsia_sdk//fuchsia:defs.bzl",
"fuchsia_bind_cc_library",
"fuchsia_bind_library",
"fuchsia_fidl_bind_library",
"fuchsia_fidl_library",
"fuchsia_fidl_llcpp_library",
)
#[START fuchsia_gizmo_library]
# This is a bind library that we manually define.
fuchsia_bind_library(
name = "examples.gizmo.bind",
srcs = [
"testlibrary.bind",
],
visibility = ["//visibility:public"],
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 = "examples.gizmo.bind_cc",
library = ":examples.gizmo.bind",
visibility = ["//visibility:public"],
# 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 = "examples.gizmo",
srcs = [
"testfidl.fidl",
],
library = "examples.gizmo",
)
# The C++ bindings for the FIDL library.
fuchsia_fidl_llcpp_library(
name = "examples.gizmo_cc",
library = ":examples.gizmo",
visibility = ["//visibility:public"],
deps = [
"@fuchsia_sdk//pkg/fidl_cpp_v2",
"@fuchsia_sdk//pkg/fidl_cpp_wire",
],
)
# We have to manually create the bind library from it.
fuchsia_fidl_bind_library(
name = "examples.gizmo_bindlib",
library = ":examples.gizmo",
visibility = ["//visibility:public"],
)
# We have to manually create the C++ lib for the FIDL based bind library we created.
fuchsia_bind_cc_library(
name = "examples.gizmo_bindlib_cc",
library = ":examples.gizmo_bindlib",
visibility = ["//visibility:public"],
)
#[END fuchsia_gizmo_protocol]