blob: 1eeb3df55b00abe63676ddf50d76ba4aac59c790 [file] [log] [blame] [edit]
# Copyright 2018 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("//build/compiled_action.gni")
import("//build/cpp/fidlmerge_cpp.gni")
# Declares a syncable library that contains C++ delegate allowing to
# send errors.
#
# Parameters
#
# fidl_target (required)
# Specifies the fidl target from which to read fidl json.
#
# deps, public_deps, test_only, visibility (optional)
# These parameters are forwarded to the source_set. This template lists
# //sdk/lib/fidl/cpp, //src/ledger/bin/fidl/syncable,
# //src/ledger/bin/public, and the value of fidl_target as public_deps.
#
template("syncable_fidl") {
assert(is_fuchsia, "This template can only be used in $target_toolchain.")
assert(defined(invoker.fidl_target),
"syncable_fidl requires parameter fidl_target.")
fidl_target = invoker.fidl_target
name = target_name
fidlmerge_cpp(name) {
forward_variables_from(invoker,
[
"deps",
"testonly",
"visibility",
])
fidl_target = "$fidl_target"
template_path = "//src/ledger/bin/fidl/syncable/syncable.fidlmerge"
generated_source_base = name
generated_source_extensions = [ ".h" ]
public_deps = [
"$fidl_target",
"//sdk/lib/fidl/cpp",
"//src/ledger/bin/fidl/syncable",
"//src/ledger/bin/public",
]
if (defined(invoker.public_deps)) {
public_deps += invoker.public_deps
}
}
}